/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'maxcompute.aliyuncs.com',
    'ap-northeast-2-pop' = 'maxcompute.aliyuncs.com',
    'ap-south-1' = 'maxcompute.aliyuncs.com',
    'ap-southeast-1' = 'maxcompute.aliyuncs.com',
    'ap-southeast-2' = 'maxcompute.aliyuncs.com',
    'ap-southeast-3' = 'maxcompute.aliyuncs.com',
    'ap-southeast-5' = 'maxcompute.aliyuncs.com',
    'cn-beijing' = 'maxcompute.aliyuncs.com',
    'cn-beijing-finance-1' = 'maxcompute.aliyuncs.com',
    'cn-beijing-finance-pop' = 'maxcompute.aliyuncs.com',
    'cn-beijing-gov-1' = 'maxcompute.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'maxcompute.aliyuncs.com',
    'cn-chengdu' = 'maxcompute.aliyuncs.com',
    'cn-edge-1' = 'maxcompute.aliyuncs.com',
    'cn-fujian' = 'maxcompute.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-finance' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'maxcompute.aliyuncs.com',
    'cn-hangzhou-test-306' = 'maxcompute.aliyuncs.com',
    'cn-hongkong' = 'maxcompute.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'maxcompute.aliyuncs.com',
    'cn-huhehaote' = 'maxcompute.aliyuncs.com',
    'cn-north-2-gov-1' = 'maxcompute.aliyuncs.com',
    'cn-qingdao' = 'maxcompute.aliyuncs.com',
    'cn-qingdao-nebula' = 'maxcompute.aliyuncs.com',
    'cn-shanghai' = 'maxcompute.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'maxcompute.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'maxcompute.aliyuncs.com',
    'cn-shanghai-finance-1' = 'maxcompute.aliyuncs.com',
    'cn-shanghai-inner' = 'maxcompute.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'maxcompute.aliyuncs.com',
    'cn-shenzhen' = 'maxcompute.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'maxcompute.aliyuncs.com',
    'cn-shenzhen-inner' = 'maxcompute.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'maxcompute.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'maxcompute.aliyuncs.com',
    'cn-wuhan' = 'maxcompute.aliyuncs.com',
    'cn-yushanfang' = 'maxcompute.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'maxcompute.aliyuncs.com',
    'cn-zhangjiakou' = 'maxcompute.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'maxcompute.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'maxcompute.aliyuncs.com',
    'eu-central-1' = 'maxcompute.aliyuncs.com',
    'eu-west-1' = 'maxcompute.aliyuncs.com',
    'eu-west-1-oxs' = 'maxcompute.aliyuncs.com',
    'me-east-1' = 'maxcompute.aliyuncs.com',
    'rus-west-1-pop' = 'maxcompute.aliyuncs.com',
    'us-east-1' = 'maxcompute.aliyuncs.com',
    'us-west-1' = 'maxcompute.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('maxcompute', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ApplyComputeQuotaPlanResponseBody = {
  data?: string(name='data', description='The data returned.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='this quota plan is not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7a316654730544735643e9200'),
}

model ApplyComputeQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyComputeQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Activate a Quota Plan Immediately.
 *
 * @description Please ensure that before using this interface, you have fully understood the <props="china">[Pricing and Charges](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Charges](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyComputeQuotaPlanResponse
 */
async function applyComputeQuotaPlanWithOptions(nickname: string, planName: string, headers: map[string]string, runtime: $RuntimeOptions): ApplyComputeQuotaPlanResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ApplyComputeQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaPlan/${$URL.percentEncode(planName)}/apply`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Activate a Quota Plan Immediately.
 *
 * @description Please ensure that before using this interface, you have fully understood the <props="china">[Pricing and Charges](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Charges](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @return ApplyComputeQuotaPlanResponse
 */
async function applyComputeQuotaPlan(nickname: string, planName: string): ApplyComputeQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return applyComputeQuotaPlanWithOptions(nickname, planName, headers, runtime);
}

model CreateComputeQuotaPlanRequest {
  name?: string(name='name', description='The name of quota plan.

This parameter is required.', example='planA'),
  quota?: {
    parameter?: {
      elasticReservedCU?: long(name='elasticReservedCU', description='The value of elastic Reserved CUs in the level-1 quota.
> The default value is 0. The maximum value of this parameter must be equal to the number of subscription-based reserved CUs and cannot exceed 10,000 CUs.

This parameter is required.', example='50'),
    }(name='parameter', description='The parameters of level-1 quota.'),
    subQuotaInfoList?: [ 
      {
        nickName?: string(name='nickName', description='The nickname of the level-2 quota.

This parameter is required.', example='os_ComputeQuota'),
        parameter?: {
          elasticReservedCU?: long(name='elasticReservedCU', description='The value of elastic Reserved CUs.
> The total number of elastically reserved CUs in all the level-2 quotas is equal to the number of elastically reserved CUs in the level-1 quota.

This parameter is required.', example='50'),
          maxCU?: long(name='maxCU', description='The value of maxCU in Reserved CUs.
> The value of maxCU must be less than or equal to the value of maxCU in the level-1 quota that you purchased.

This parameter is required.', example='50'),
          minCU?: long(name='minCU', description='The value of minCU in Reserved CUs.
> 
>- The total value of minCU in all the level-2 quotas is equal to the value of minCU in the level-1 quota.
>- The value of minCU must be less than or equal to the value of maxCU in the level-2 quota and less than or equal to the value of minCU in the level-1 quota that you purchased.

This parameter is required.', example='50'),
        }(name='parameter', description='The parameters of the level-2 quota.'),
      }
    ](name='subQuotaInfoList', description='The list of level-2 quotas.'),
  }(name='quota', description='The parameters of quota plan.'),
}

model CreateComputeQuotaPlanResponseBody = {
  data?: string(name='data', description='The returned data.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='this quota is not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0b87b7e716665825896565060e87a4'),
}

model CreateComputeQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateComputeQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Create MaxCompute ComputeQuotaPlan.
 *
 * @description Please ensure that before using this interface, you have fully understood the <props="china">[Pricing and Charges](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Charges](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param request CreateComputeQuotaPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateComputeQuotaPlanResponse
 */
async function createComputeQuotaPlanWithOptions(nickname: string, request: CreateComputeQuotaPlanRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateComputeQuotaPlanResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.quota)) {
    body['quota'] = request.quota;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateComputeQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaPlan`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create MaxCompute ComputeQuotaPlan.
 *
 * @description Please ensure that before using this interface, you have fully understood the <props="china">[Pricing and Charges](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Charges](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param request CreateComputeQuotaPlanRequest
 * @return CreateComputeQuotaPlanResponse
 */
async function createComputeQuotaPlan(nickname: string, request: CreateComputeQuotaPlanRequest): CreateComputeQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createComputeQuotaPlanWithOptions(nickname, request, headers, runtime);
}

model CreateMmsDataSourceRequest {
  config?: map[string]any(name='config'),
  name?: string(name='name', example='demo'),
  networklink?: string(name='networklink', example='vpc-uf6pc2vordian33gobzfr:cn-shanghai'),
  type?: string(name='type', example='BIGQUERY'),
}

model CreateMmsDataSourceResponseBody = {
  data?: {
    dataSourceId?: long(name='dataSourceId', example='18'),
  }(name='data'),
  requestId?: string(name='requestId', example='B42CA730-8187-50F1-9FE0-6733297036DB'),
}

model CreateMmsDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMmsDataSourceResponseBody(name='body'),
}

/**
 * @param request CreateMmsDataSourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMmsDataSourceResponse
 */
async function createMmsDataSourceWithOptions(request: CreateMmsDataSourceRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateMmsDataSourceResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.config)) {
    body['config'] = request.config;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.networklink)) {
    body['networklink'] = request.networklink;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateMmsDataSource',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateMmsDataSourceRequest
 * @return CreateMmsDataSourceResponse
 */
async function createMmsDataSource(request: CreateMmsDataSourceRequest): CreateMmsDataSourceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createMmsDataSourceWithOptions(request, headers, runtime);
}

model CreateMmsFetchMetadataJobResponseBody = {
  data?: {
    scanId?: long(name='scanId', example='1000002'),
  }(name='data'),
  requestId?: string(name='requestId', example='CC4D05E8-0613-5A8E-9339-A0EBD097A69E'),
}

model CreateMmsFetchMetadataJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMmsFetchMetadataJobResponseBody(name='body'),
}

/**
 * @summary 创建数据源的更新元数据操作
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMmsFetchMetadataJobResponse
 */
async function createMmsFetchMetadataJobWithOptions(sourceId: string, headers: map[string]string, runtime: $RuntimeOptions): CreateMmsFetchMetadataJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateMmsFetchMetadataJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/scans`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建数据源的更新元数据操作
 *
 * @return CreateMmsFetchMetadataJobResponse
 */
async function createMmsFetchMetadataJob(sourceId: string): CreateMmsFetchMetadataJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createMmsFetchMetadataJobWithOptions(sourceId, headers, runtime);
}

model CreateMmsJobRequest {
  columnMapping?: map[string]string(name='columnMapping'),
  dstDbName?: string(name='dstDbName'),
  dstSchemaName?: string(name='dstSchemaName'),
  enableVerification?: boolean(name='enableVerification'),
  eta?: string(name='eta'),
  increment?: boolean(name='increment'),
  name?: string(name='name'),
  others?: map[string]any(name='others'),
  partitionFilters?: map[string]string(name='partitionFilters'),
  partitions?: [ long ](name='partitions'),
  schemaOnly?: boolean(name='schemaOnly'),
  sourceId?: long(name='sourceId'),
  sourceName?: string(name='sourceName'),
  srcDbName?: string(name='srcDbName'),
  srcSchemaName?: string(name='srcSchemaName'),
  tableBlackList?: [ string ](name='tableBlackList'),
  tableMapping?: map[string]string(name='tableMapping'),
  tableWhiteList?: [ string ](name='tableWhiteList'),
  tables?: [ string ](name='tables'),
  taskType?: string(name='taskType', description='MOCK, HIVE: hive udtf task, HIVE_DATAX: hive datax task, COPY_TASK: odps Copy Task, ODPS_INSERT_OVERWRITE: odps simple insert overwrite task, MC2MC_VERIFY, OSS, HIVE_OSS'),
}

model CreateMmsJobResponseBody = {
  data?: {
    asyncTaskId?: long(name='asyncTaskId'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model CreateMmsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMmsJobResponseBody(name='body'),
}

/**
 * @summary 创建迁移任务
 *
 * @param request CreateMmsJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMmsJobResponse
 */
async function createMmsJobWithOptions(sourceId: string, request: CreateMmsJobRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateMmsJobResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.columnMapping)) {
    body['columnMapping'] = request.columnMapping;
  }
  if (!$isNull(request.dstDbName)) {
    body['dstDbName'] = request.dstDbName;
  }
  if (!$isNull(request.dstSchemaName)) {
    body['dstSchemaName'] = request.dstSchemaName;
  }
  if (!$isNull(request.enableVerification)) {
    body['enableVerification'] = request.enableVerification;
  }
  if (!$isNull(request.eta)) {
    body['eta'] = request.eta;
  }
  if (!$isNull(request.increment)) {
    body['increment'] = request.increment;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.others)) {
    body['others'] = request.others;
  }
  if (!$isNull(request.partitionFilters)) {
    body['partitionFilters'] = request.partitionFilters;
  }
  if (!$isNull(request.partitions)) {
    body['partitions'] = request.partitions;
  }
  if (!$isNull(request.schemaOnly)) {
    body['schemaOnly'] = request.schemaOnly;
  }
  if (!$isNull(request.sourceId)) {
    body['sourceId'] = request.sourceId;
  }
  if (!$isNull(request.sourceName)) {
    body['sourceName'] = request.sourceName;
  }
  if (!$isNull(request.srcDbName)) {
    body['srcDbName'] = request.srcDbName;
  }
  if (!$isNull(request.srcSchemaName)) {
    body['srcSchemaName'] = request.srcSchemaName;
  }
  if (!$isNull(request.tableBlackList)) {
    body['tableBlackList'] = request.tableBlackList;
  }
  if (!$isNull(request.tableMapping)) {
    body['tableMapping'] = request.tableMapping;
  }
  if (!$isNull(request.tableWhiteList)) {
    body['tableWhiteList'] = request.tableWhiteList;
  }
  if (!$isNull(request.tables)) {
    body['tables'] = request.tables;
  }
  if (!$isNull(request.taskType)) {
    body['taskType'] = request.taskType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateMmsJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建迁移任务
 *
 * @param request CreateMmsJobRequest
 * @return CreateMmsJobResponse
 */
async function createMmsJob(sourceId: string, request: CreateMmsJobRequest): CreateMmsJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createMmsJobWithOptions(sourceId, request, headers, runtime);
}

model CreatePackageRequest {
  body?: string(name='body', description='The request body parameters.', example='{
"name": "test_packege", 
    "resourceList": { 
        "table": [
            {
                "name": "table_name",
                "actions": [
                    "Describe",
                    "Select"
                ]
            },
            {
                "name": "table_name",
                "actions": [
                    "Describe",
                    "Select"
                ]
            }
        ],
        "resource": [
            {
                "name": "",
                "actions": []
            },
            {
                "name": "",
                "actions": []
            }
        ],
        "function": [
            {
                "name": "",
                "actions": []
            },
            {
                "name": "",
                "actions": []
            }
        ]
    }
}'),
  isInstall?: boolean(name='isInstall', description='Specifies whether to install the package.', example='false'),
}

model CreatePackageResponseBody = {
  data?: string(name='data', description='The returned data.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc3b4ab16684833172127321e2c25'),
}

model CreatePackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePackageResponseBody(name='body'),
}

/**
 * @summary Creates a package.
 *
 * @param request CreatePackageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePackageResponse
 */
async function createPackageWithOptions(projectName: string, request: CreatePackageRequest, headers: map[string]string, runtime: $RuntimeOptions): CreatePackageResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.isInstall)) {
    query['isInstall'] = request.isInstall;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'CreatePackage',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/packages`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a package.
 *
 * @param request CreatePackageRequest
 * @return CreatePackageResponse
 */
async function createPackage(projectName: string, request: CreatePackageRequest): CreatePackageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createPackageWithOptions(projectName, request, headers, runtime);
}

model CreateProjectRequest {
  body?: string(name='body', description='The request body parameters.'),
}

model CreateProjectResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0b87b7a316654730544735643e9200'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary Creates a MaxCompute project.
 *
 * @param request CreateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(request: CreateProjectRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateProjectResponse {
  request.validate();
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateProject',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a MaxCompute project.
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectWithOptions(request, headers, runtime);
}

model CreateQuotaPlanRequest {
  body?: string(name='body', description='The request body parameters.', example='{ "name": "planA", // The quota is a level-1 quota. You can select only the fields that are related to the quota plan. "quota": { "name": "a", "nickName": "aaa_nick", "tenantId": "10001", "regionId": "cn-hangzhou", "parentId": "0", "cluster": "AT-ODPS-TEST3", "parameter": { "minCU": 40, "maxCU": 40, "adhocCU": 0, "elasticMinCU": 40, "elasticMaxCU": 40, "enablePreemptiveScheduling": false, "forceReservedMin":true, "enablePriority":false, "singleJobCULimit":100, "adhocQuotaBeginTimeInSec": 1345, "adhocQuotaEndTimeInSec": 1234, "ignoreAdhocQuota":false }, "subQuotaInfoList": [ { "nickName": "WlmFuxiSecondaryOnlineQuotaTest", "name": "WlmFuxiSecondaryOnlineQuotaTest", "type": "FUXI_ONLINE", "tenantId": "10001", "regionId": "cn-hangzhou", "cluster": "AT-ODPS-TEST3", "parameter": { "minCU": 40, "maxCU": 40, "adhocCU": 0, "elasticMinCU": 40, "elasticMaxCU": 40, "enablePreemptiveScheduling": false, "forceReservedMin":true, "enablePriority":false, "singleJobCULimit":100, "adhocQuotaBeginTimeInSec": 1345, "adhocQuotaEndTimeInSec": 1234, "ignoreAdhocQuota":false } } ] } }'),
  region?: string(name='region', description='The ID of the region.', example='cn-beijing'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='228451885265153'),
}

model CreateQuotaPlanResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc3b4b016674434996033675e71ee'),
}

model CreateQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Creates a quota plan.
 *
 * @param request CreateQuotaPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateQuotaPlanResponse
 */
async function createQuotaPlanWithOptions(nickname: string, request: CreateQuotaPlanRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateQuotaPlanResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/plans`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a quota plan.
 *
 * @param request CreateQuotaPlanRequest
 * @return CreateQuotaPlanResponse
 */
async function createQuotaPlan(nickname: string, request: CreateQuotaPlanRequest): CreateQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createQuotaPlanWithOptions(nickname, request, headers, runtime);
}

model CreateRoleRequest {
  body?: string(name='body', description='The request body parameters. For valid values, see [MaxCompute permissions](https://help.aliyun.com/document_detail/27935.html).', example='{"name": "role_name","type": "resource/adminn","policy": "", // The document of the policy. This parameter is not required if an access-control list (ACL) is used. "acl": { // This parameter is not required if a policy is used. "table": [{"name": "", "actions":["","",]}, {"name": "", "actions":[]}],"resource":[{"name": "", "actions":["","",]}, {"name": "", "actions":[]}],"function":[{"name": "", "actions":["","",]}, {"name": "", "actions":[]}],"package":[{"name": "", "actions":["","",]}, {"name": "", "actions":[]}],"project":[{"name": "", "actions":[]}], // Only the current project is displayed in the console. "instance":[{"name": "", "actions":[]}] // The parameter name must be set to an asterisk (\\\\*) in the console. }}// An asterisk (\\\\*) can be specified for name.'),
}

model CreateRoleResponseBody = {
  data?: string(name='data', description='The returned data.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0b87b7e716665825896565060e87a4'),
}

model CreateRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRoleResponseBody(name='body'),
}

/**
 * @summary Creates a role at the MaxCompute project level.
 *
 * @param request CreateRoleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRoleResponse
 */
async function createRoleWithOptions(projectName: string, request: CreateRoleRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateRoleResponse {
  request.validate();
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateRole',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/roles`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a role at the MaxCompute project level.
 *
 * @param request CreateRoleRequest
 * @return CreateRoleResponse
 */
async function createRole(projectName: string, request: CreateRoleRequest): CreateRoleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createRoleWithOptions(projectName, request, headers, runtime);
}

model DeleteComputeQuotaPlanResponseBody = {
  data?: string(name='data', description='The returned data.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='this quota plan is not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7a316654730544735643e9200'),
}

model DeleteComputeQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteComputeQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Delete MaxCompute compute quota plan.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteComputeQuotaPlanResponse
 */
async function deleteComputeQuotaPlanWithOptions(nickname: string, planName: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteComputeQuotaPlanResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteComputeQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaPlan/${$URL.percentEncode(planName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete MaxCompute compute quota plan.
 *
 * @return DeleteComputeQuotaPlanResponse
 */
async function deleteComputeQuotaPlan(nickname: string, planName: string): DeleteComputeQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteComputeQuotaPlanWithOptions(nickname, planName, headers, runtime);
}

model DeleteMmsDataSourceResponseBody = {
  data?: long(name='data', example='2000015'),
  requestId?: string(name='requestId', example='EA1320AB-7766-5EC7-B0F6-8B20E2298567'),
}

model DeleteMmsDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMmsDataSourceResponseBody(name='body'),
}

/**
 * @summary 删除数据源
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMmsDataSourceResponse
 */
async function deleteMmsDataSourceWithOptions(sourceId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteMmsDataSourceResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteMmsDataSource',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除数据源
 *
 * @return DeleteMmsDataSourceResponse
 */
async function deleteMmsDataSource(sourceId: string): DeleteMmsDataSourceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteMmsDataSourceWithOptions(sourceId, headers, runtime);
}

model DeleteMmsJobResponseBody = {
  data?: long(name='data', example='88'),
  requestId?: string(name='requestId', example='31BE216F-AEF7-581E-B9C9-DECEB5424AC4'),
}

model DeleteMmsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMmsJobResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMmsJobResponse
 */
async function deleteMmsJobWithOptions(sourceId: string, jobId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteMmsJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteMmsJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs/${$URL.percentEncode(jobId)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return DeleteMmsJobResponse
 */
async function deleteMmsJob(sourceId: string, jobId: string): DeleteMmsJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteMmsJobWithOptions(sourceId, jobId, headers, runtime);
}

model DeleteQuotaPlanRequest {
  region?: string(name='region', description='The ID of the region.', example='cn-hangzhou'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='416441016836866'),
}

model DeleteQuotaPlanResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0b57ff7616612271051086500ea3ce'),
}

model DeleteQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Deletes a quota plan.
 *
 * @param request DeleteQuotaPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteQuotaPlanResponse
 */
async function deleteQuotaPlanWithOptions(nickname: string, planName: string, request: DeleteQuotaPlanRequest, headers: map[string]string, runtime: $RuntimeOptions): DeleteQuotaPlanResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/plans/${$URL.percentEncode(planName)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a quota plan.
 *
 * @param request DeleteQuotaPlanRequest
 * @return DeleteQuotaPlanResponse
 */
async function deleteQuotaPlan(nickname: string, planName: string, request: DeleteQuotaPlanRequest): DeleteQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteQuotaPlanWithOptions(nickname, planName, request, headers, runtime);
}

model GetComputeEffectivePlanResponseBody = {
  data?: {
    createTime?: string(name='createTime', description='The time when the quota plan was created.', example='1714356241163'),
    isEffective?: boolean(name='isEffective', description='Whether it is currently effective.
> A Quota plan that has taken effect cannot be deleted, i.e., isEffective=true', example='true/false'),
    name?: string(name='name', description='The name of the quota plan.', example='planA'),
    quota?: {
      cluster?: string(name='cluster', description='The ID of the cluster.', example='AT-120N'),
      createTime?: long(name='createTime', description='The time when the level-1 quota was created.', example='1719886322347'),
      creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
      id?: string(name='id', description='The ID of the level-1 quota.', example='2413'),
      name?: string(name='name', description='The name of the level-1 quota.', example='dp_cn_shanghai_1699533470_p'),
      nickName?: string(name='nickName', description='The nickname of the level-1 quota.', example='os_MyQuota_p'),
      parameter?: map[string]any(name='parameter', description='The description of the level-2 quota.', example='{
  "enablePriority": false,
  "minCU": 25,
  "adhocCU": 0,
  "elasticReservedCU": 0,
  "forceReservedMin": false,
  "maxCU": 50,
  "schedulerType": "Fifo"
}'),
      regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
      status?: string(name='status', description='The status of the resource.', example='ON'),
      subQuotaInfoList?: [ 
        {
          cluster?: string(name='cluster', description='The ID of the cluster.', example='AT-120N'),
          createTime?: long(name='createTime', description='The time when the resource was created.', example='1718155201628'),
          creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
          id?: string(name='id', description='The ID of the level-2 quota.', example='10940'),
          name?: string(name='name', description='The name of the level-2 quota.', example='dp_cn_shanghai_1696659792_p'),
          nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='os_MyQuota'),
          parameter?: map[string]any(name='parameter', description='The description of the level-2 quota.', example='{
  "enablePriority": false,
  "minCU": 25,
  "adhocCU": 0,
  "elasticReservedCU": 0,
  "forceReservedMin": false,
  "maxCU": 50,
  "schedulerType": "Fifo"
}'),
          regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
          status?: string(name='status', description='Resource status.', example='ON'),
          tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
          type?: string(name='type', description='The type of quota.', example='FUXI_ONLINE'),
          version?: string(name='version', description='The version number.', example='1386'),
        }
      ](name='subQuotaInfoList', description='The list of subquotas.'),
      tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
      type?: string(name='type', description='The type of quota.', example='FUXI_ONLINE'),
      version?: string(name='version', description='The version number.', example='1964'),
    }(name='quota', description='The details of the quota.'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='success'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='plan \\\\"***\\\\" does not exist'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='688003E1-D1B4-5468-957E-2FFB3AC8D79B'),
}

model GetComputeEffectivePlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComputeEffectivePlanResponseBody(name='body'),
}

/**
 * @summary GetComputeEffectivePlan.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetComputeEffectivePlanResponse
 */
async function getComputeEffectivePlanWithOptions(nickname: string, headers: map[string]string, runtime: $RuntimeOptions): GetComputeEffectivePlanResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetComputeEffectivePlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeEffectivePlan/`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetComputeEffectivePlan.
 *
 * @return GetComputeEffectivePlanResponse
 */
async function getComputeEffectivePlan(nickname: string): GetComputeEffectivePlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getComputeEffectivePlanWithOptions(nickname, headers, runtime);
}

model GetComputeQuotaPlanResponseBody = {
  data?: {
    createTime?: string(name='createTime', description='The time when the quota plan was created.', example='1730946421757'),
    isEffective?: boolean(name='isEffective', description='Whether it is currently effective.
> 
> - A Quota plan that has taken effect cannot be deleted, i.e., isEffective=true', example='true/false'),
    name?: string(name='name', description='The name of the quota plan.', example='planA'),
    quota?: {
      cluster?: string(name='cluster', description='Cluster ID.', example='AT-120N'),
      createTime?: long(name='createTime', description='Creation time.', example='1719886322347'),
      creatorId?: string(name='creatorId', description='Creator\\\\"s cloud account UID.', example='672863518'),
      id?: string(name='id', description='The ID of the level-1 quota.', example='2413'),
      name?: string(name='name', description='The name of the level-1 quota.', example='quota_a'),
      nickName?: string(name='nickName', description='The nickname of the level-1 quota.', example='quota_nickname'),
      parameter?: {
        elasticReservedCU?: long(name='elasticReservedCU', description='The value of elastic Reserved CUs.', example='50'),
        maxCU?: long(name='maxCU', description='The value of maxCU in Reserved CUs.', example='50'),
        minCU?: long(name='minCU', description='The value of minCU in Reserved CUs.', example='50'),
      }(name='parameter', description='CU value parameters for the level-1 quota.'),
      regionId?: string(name='regionId', description='Region ID.', example='cn-beijing'),
      status?: string(name='status', description='Resource status.', example='ON'),
      subQuotaInfoList?: [ 
        {
          cluster?: string(name='cluster', description='Cluster ID.', example='AT-120N'),
          createTime?: long(name='createTime', description='Creation time.', example='1718155201628'),
          creatorId?: string(name='creatorId', description='Creator cloud account UID.', example='672863518'),
          id?: string(name='id', description='The ID of the level-2 quota.', example='10940'),
          name?: string(name='name', description='The name of the level-2 quota.', example='dp_cn_shanghai_1696659792_p'),
          nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='subquotaA'),
          parameter?: {
            elasticReservedCU?: long(name='elasticReservedCU', description='The value of elastic Reserved CUs.', example='50'),
            enablePriority?: boolean(name='enablePriority', description='whether to enable the priority feature.', example='true/false'),
            forceReservedMin?: boolean(name='forceReservedMin', description='Whether it is exclusive.', example='true/false'),
            maxCU?: long(name='maxCU', description='The value of maxCU in Reserved CUs.', example='50'),
            minCU?: long(name='minCU', description='The value of minCU in Reserved CUs.', example='50'),
            schedulerType?: string(name='schedulerType', description='Scheduling policy.', example='Fifo/Fair'),
            singleJobCULimit?: long(name='singleJobCULimit', description='The upper limit for CUs that can be concurrently used by a job scheduled to the quota.', example='50'),
          }(name='parameter', description='The parameters of the level-2 quota.'),
          regionId?: string(name='regionId', description='Region ID.', example='cn-beijing'),
          status?: string(name='status', description='Resource status.', example='ON'),
          tenantId?: string(name='tenantId', description='Tenant ID.', example='478403690625249'),
          type?: string(name='type', description='The type of quota.', example='FUXI_ONLINE'),
          version?: string(name='version', description='Version number.', example='1386'),
        }
      ](name='subQuotaInfoList', description='The list of level-2 quotas.'),
      tenantId?: string(name='tenantId', description='Tenant ID.', example='478403690625249'),
      type?: string(name='type', description='Corresponds to the `resourceSystemType` field of the control cluster.', example='FUXI_ONLINE'),
      version?: string(name='version', description='Version number.', example='1964'),
    }(name='quota', description='The details of the quota.'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='QUOTA_PLAN_NOT_FOUND'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='plan \\\\"***\\\\" does not exist'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='EA1320AB-7766-5EC7-B0F6-8B20E2298567'),
}

model GetComputeQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComputeQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Get detailed information of a single compute quota plan.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetComputeQuotaPlanResponse
 */
async function getComputeQuotaPlanWithOptions(nickname: string, planName: string, headers: map[string]string, runtime: $RuntimeOptions): GetComputeQuotaPlanResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetComputeQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaPlan/${$URL.percentEncode(planName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get detailed information of a single compute quota plan.
 *
 * @return GetComputeQuotaPlanResponse
 */
async function getComputeQuotaPlan(nickname: string, planName: string): GetComputeQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getComputeQuotaPlanWithOptions(nickname, planName, headers, runtime);
}

model GetComputeQuotaScheduleRequest {
  displayTimezone?: string(name='displayTimezone', description='Display time zone.', example='UTC+8'),
}

model GetComputeQuotaScheduleResponseBody = {
  data?: [ 
    {
      condition?: {
        at?: string(name='at', description='The start time when the quota plan takes effect.', example='09:00'),
      }(name='condition', description='The value of effective condition.'),
      id?: string(name='id', description='The ID of the quota plan.', example='89b54db44d384f26964951ea457f64a5'),
      plan?: string(name='plan', description='The name of the quota plan.', example='planA'),
      timezone?: string(name='timezone', description='The time zone property.', example='UTC+8'),
      type?: string(name='type', description='The type of the quota plan.', example='daily'),
    }
  ](name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='QUOTA_UNKNOWN_NICKNAME'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='Cannot found quota **'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='B42CA730-8187-50F1-9FE0-6733297036DB'),
}

model GetComputeQuotaScheduleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComputeQuotaScheduleResponseBody(name='body'),
}

/**
 * @summary Displays the time-specific configuration of compute quota.
 *
 * @param request GetComputeQuotaScheduleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetComputeQuotaScheduleResponse
 */
async function getComputeQuotaScheduleWithOptions(nickname: string, request: GetComputeQuotaScheduleRequest, headers: map[string]string, runtime: $RuntimeOptions): GetComputeQuotaScheduleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.displayTimezone)) {
    query['displayTimezone'] = request.displayTimezone;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetComputeQuotaSchedule',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaSchedule`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Displays the time-specific configuration of compute quota.
 *
 * @param request GetComputeQuotaScheduleRequest
 * @return GetComputeQuotaScheduleResponse
 */
async function getComputeQuotaSchedule(nickname: string, request: GetComputeQuotaScheduleRequest): GetComputeQuotaScheduleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getComputeQuotaScheduleWithOptions(nickname, request, headers, runtime);
}

model GetJobInfoResponseBody = {
  data?: {
    cuUsage?: long(name='cuUsage', description='CPU usage of the job at the snapshot time. Unit: Core.', example='10'),
    endAtTime?: long(name='endAtTime', description='The time when the job was finished.', example='1672112913'),
    extNodeId?: string(name='extNodeId', description='The ID of the upstream node.', example='node_4'),
    extNodeOnDuty?: string(name='extNodeOnDuty', description='The account ID of the task owner.', example='duty_2'),
    extPlantFrom?: string(name='extPlantFrom', description='The upstream platform.', example='platform_3'),
    inputBytes?: double(name='inputBytes', description='The amount of scanned data for the job. Unit: byte.', example='1234'),
    instanceId?: string(name='instanceId', description='The instance ID.', example='20230410****60gg'),
    jobOwner?: string(name='jobOwner', description='The account that commits the job.', example='ALIYUN$7632***@aliyun.com'),
    jobSubStatusList?: [ 
      {
        code?: int32(name='code', description='The code of the sub-status.', example='1010'),
        description?: string(name='description', description='The description of the sub-status.', example='Waiting for scheduling'),
        startTime?: string(name='startTime', description='The start time of the sub-status.', example='2025-03-05 00:04:15.717364 +0800'),
      }
    ](name='jobSubStatusList', description='The list of sub-status of the job.'),
    jobType?: string(name='jobType', description='The type of the job.', example='SQL'),
    memoryUsage?: long(name='memoryUsage', description='Memory usage of the job at the snapshot time. Unit: MB.', example='40'),
    priority?: long(name='priority', description='The priority of the job.', example='1'),
    project?: string(name='project', description='The name of the project.', example='dp_cdm_prod'),
    quotaNickname?: string(name='quotaNickname', description='The nickname of the computing Quota used by the job.', example='os_bigdata'),
    quotaType?: string(name='quotaType', description='The type of the quota.', example='subscription'),
    region?: string(name='region', description='The region ID.', example='cn-shanghai'),
    runningAtTime?: long(name='runningAtTime', description='The start time of the job.
> The time when the job received the first batch of computing resources.', example='1672112113'),
    runningTime?: long(name='runningTime', description='The running duration, which is the duration from the runningAtTime to the snapshotTime of the job. Unit: seconds (s).', example='800'),
    sceneResults?: [ 
      {
        description?: string(name='description', description='The intelligent diagnostics result description.', example='This job uses annual and monthly computing resources. It may be that the job is waiting for resources due to the large amount of overall job running data, many resources requested, and low job priority. Please go to Resource Consumption to view the specific situation. You can also go to Cost Optimization to see if you need to adjust resource configuration.'),
        params?: map[string]string(name='params', description='Information about the nodes where data skew or data expansion is detected. This parameter is returned only when the diagnostics scenario is data skew or data expansion.'),
        scene?: string(name='scene', description='The intelligent diagnostics result scenario.', example='LackResource'),
        sceneTag?: string(name='sceneTag', description='The intelligent diagnostics result tag.', example='SubscriptionLackResource'),
        summary?: string(name='summary', description='The intelligent diagnostics result summary.', example='Insufficient computing resources available for the job. Click to view details.'),
        type?: string(name='type', description='The intelligent diagnostics result type.', example='warning'),
      }
    ](name='sceneResults', description='The intelligent diagnostics results.'),
    signature?: string(name='signature', description='The signature of the SQL job.', example='20c1efb4a7caca1865f4aa784bb500efae74af04'),
    status?: string(name='status', description='The status of the job.', example='running'),
    submittedAtTime?: long(name='submittedAtTime', description='The time when the job was committed.', example='1672112013'),
    tenantId?: string(name='tenantId', description='The tenant ID.', example='4784****5249'),
    totalTime?: long(name='totalTime', description='The interval from the time when the job was submitted to the snapshotTime .Unit: seconds (s).', example='900'),
    waitingTime?: long(name='waitingTime', description='The duration from the time the job is submitted to the time the job starts to run. Unit: seconds (s).', example='100'),
  }(name='data', description='The returned data.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters and syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0be3e0bb16654558425251398e27a9'),
}

model GetJobInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobInfoResponseBody(name='body'),
}

/**
 * @summary Get basic information about a single job.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobInfoResponse
 */
async function getJobInfoWithOptions(instanceId: string, headers: map[string]string, runtime: $RuntimeOptions): GetJobInfoResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetJobInfo',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/${$URL.percentEncode(instanceId)}/info`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get basic information about a single job.
 *
 * @return GetJobInfoResponse
 */
async function getJobInfo(instanceId: string): GetJobInfoResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getJobInfoWithOptions(instanceId, headers, runtime);
}

model GetJobResourceUsageRequest {
  date?: string(name='date', description='The date that is accurate to the day part for the query. The date must be in the yyyy-MM-dd format.

This parameter is required.', example='2023-05-15'),
  jobOwnerList?: [ string ](name='jobOwnerList', description='The list of job executors.'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10. Maximum value: 100.', example='10'),
  quotaNicknameList?: [ string ](name='quotaNicknameList', description='The list of nicknames of quotas that are used by jobs.'),
}

model GetJobResourceUsageShrinkRequest {
  date?: string(name='date', description='The date that is accurate to the day part for the query. The date must be in the yyyy-MM-dd format.

This parameter is required.', example='2023-05-15'),
  jobOwnerListShrink?: string(name='jobOwnerList', description='The list of job executors.'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10. Maximum value: 100.', example='10'),
  quotaNicknameListShrink?: string(name='quotaNicknameList', description='The list of nicknames of quotas that are used by jobs.'),
}

model GetJobResourceUsageResponseBody = {
  data?: {
    jobResourceUsageList?: [ 
      {
        cuUsage?: long(name='cuUsage', description='The total number of used compute units (CUs).', example='1185100'),
        date?: string(name='date', description='The start date of the query in the format of yyyy-MM-dd.', example='2023-05-09'),
        jobOwner?: string(name='jobOwner', description='The job executor.', example='ALIYUN$xxx@test.aliyunid.com'),
        memoryUsage?: long(name='memoryUsage', description='The total memory usage.', example='15169536'),
        quotaNickname?: string(name='quotaNickname', description='The quota nickname.', example='my_quota'),
      }
    ](name='jobResourceUsageList', description='The data list returned.'),
    pageNumber?: long(name='pageNumber', description='The page number.', example='2'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='totalCount', description='The total number of returned entries.', example='64'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code returned if the request failed.', example='success'),
  errorMsg?: string(name='errorMsg', description='The error message returned if the request failed.', example='0A3B1E82006A23A918C70905BF08AEC7'),
  httpCode?: int32(name='httpCode', description='Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b57ff7616612271051086500ea3ce'),
}

model GetJobResourceUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobResourceUsageResponseBody(name='body'),
}

/**
 * @summary Performs statistics on all jobs that are complete on a specified day and obtains the total resource usage of each job executor on a daily basis.
 *
 * @param tmpReq GetJobResourceUsageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobResourceUsageResponse
 */
async function getJobResourceUsageWithOptions(tmpReq: GetJobResourceUsageRequest, headers: map[string]string, runtime: $RuntimeOptions): GetJobResourceUsageResponse {
  tmpReq.validate();
  var request = new GetJobResourceUsageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.jobOwnerList)) {
    request.jobOwnerListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobOwnerList, 'jobOwnerList', 'simple');
  }
  if (!$isNull(tmpReq.quotaNicknameList)) {
    request.quotaNicknameListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.quotaNicknameList, 'quotaNicknameList', 'simple');
  }
  var query : map[string]any = {};
  if (!$isNull(request.date)) {
    query['date'] = request.date;
  }
  if (!$isNull(request.jobOwnerListShrink)) {
    query['jobOwnerList'] = request.jobOwnerListShrink;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.quotaNicknameListShrink)) {
    query['quotaNicknameList'] = request.quotaNicknameListShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetJobResourceUsage',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/resourceUsage`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Performs statistics on all jobs that are complete on a specified day and obtains the total resource usage of each job executor on a daily basis.
 *
 * @param request GetJobResourceUsageRequest
 * @return GetJobResourceUsageResponse
 */
async function getJobResourceUsage(request: GetJobResourceUsageRequest): GetJobResourceUsageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getJobResourceUsageWithOptions(request, headers, runtime);
}

model GetMmsAsyncTaskResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2024-12-17 15:44:00'),
    endTime?: string(name='endTime', example='2024-12-17 17:44:17'),
    errorMsg?: string(name='errorMsg', example='null'),
    id?: long(name='id', example='2523'),
    objectId?: long(name='objectId', example='232'),
    progress?: int32(name='progress', example='0'),
    result?: string(name='result', example='null'),
    running?: boolean(name='running', example='false'),
    sourceId?: long(name='sourceId', example='2000017'),
    startTime?: string(name='startTime', example='2024-12-17 15:44:17'),
    status?: string(name='status', example='DONE'),
    type?: string(name='type', example='TASK_CREATE'),
  }(name='data'),
  requestId?: string(name='requestId', example='688003E1-D1B4-5468-957E-2FFB3AC8D79B'),
}

model GetMmsAsyncTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsAsyncTaskResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsAsyncTaskResponse
 */
async function getMmsAsyncTaskWithOptions(sourceId: string, asyncTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsAsyncTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsAsyncTask',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/asyncTasks/${$URL.percentEncode(asyncTaskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsAsyncTaskResponse
 */
async function getMmsAsyncTask(sourceId: string, asyncTaskId: string): GetMmsAsyncTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsAsyncTaskWithOptions(sourceId, asyncTaskId, headers, runtime);
}

model GetMmsDataSourceRequest {
  lang?: string(name='lang', example='en_US'),
  withConfig?: boolean(name='withConfig', example='true'),
}

model GetMmsDataSourceResponseBody = {
  data?: {
    agentIsOnline?: boolean(name='agentIsOnline', example='true'),
    config?: [ 
      {
        desc?: string(name='desc'),
        enums?: [ string ](name='enums'),
        group?: string(name='group', example='basic_group'),
        key?: string(name='key', example='bigquery.range.partition.migrate.type'),
        name?: string(name='name'),
        placeHolder?: string(name='placeHolder', example='Cluster or Partition'),
        required?: boolean(name='required', example='true'),
        subType?: string(name='subType', example='.keytab'),
        type?: string(name='type', example='string'),
        value?: any(name='value', example='Partition'),
      }
    ](name='config'),
    createTime?: string(name='createTime', example='2024-12-17 09:29:58'),
    dbNum?: int32(name='dbNum', example='3'),
    errMsg?: string(name='errMsg', example='unexpected exception'),
    id?: long(name='id', example='2000015'),
    lastUpdateTime?: string(name='lastUpdateTime', example='2024-12-17 15:44:17'),
    name?: string(name='name', example='demo'),
    networklink?: string(name='networklink', example='vpc-2zebqp6uojhdla46677tl:cn-shanghai'),
    partitionNum?: int32(name='partitionNum', example='10000000'),
    partitionsDoingNum?: int32(name='partitionsDoingNum', example='23322'),
    partitionsDoneNum?: int32(name='partitionsDoneNum', example='11113'),
    partitionsFailedNum?: int32(name='partitionsFailedNum', example='32'),
    region?: string(name='region', example='cn-shanghai'),
    scanId?: long(name='scanId', example='1000253'),
    status?: string(name='status', example='STARTED'),
    tableNum?: int32(name='tableNum', example='1000'),
    tablesDoingNum?: int32(name='tablesDoingNum', example='19'),
    tablesDoneNum?: int32(name='tablesDoneNum', example='16'),
    tablesFailedNum?: int32(name='tablesFailedNum', example='2'),
    tablesPartDoneNum?: int32(name='tablesPartDoneNum', example='123'),
    type?: string(name='type', example='BIGQUERY'),
  }(name='data'),
  requestId?: string(name='requestId', example='98EC8C47-3D6D-560C-808B-84E494220A32'),
}

model GetMmsDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsDataSourceResponseBody(name='body'),
}

/**
 * @param request GetMmsDataSourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsDataSourceResponse
 */
async function getMmsDataSourceWithOptions(sourceId: string, request: GetMmsDataSourceRequest, headers: map[string]string, runtime: $RuntimeOptions): GetMmsDataSourceResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.lang)) {
    query['lang'] = request.lang;
  }
  if (!$isNull(request.withConfig)) {
    query['withConfig'] = request.withConfig;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsDataSource',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetMmsDataSourceRequest
 * @return GetMmsDataSourceResponse
 */
async function getMmsDataSource(sourceId: string, request: GetMmsDataSourceRequest): GetMmsDataSourceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsDataSourceWithOptions(sourceId, request, headers, runtime);
}

model GetMmsDbResponseBody = {
  data?: {
    description?: string(name='description', example='for mms_test'),
    extra?: string(name='extra', example='{}'),
    id?: long(name='id', example='63'),
    lastDdlTime?: string(name='lastDdlTime', description='last ddl time', example='2024-12-17 15:44:42'),
    location?: string(name='location', example='hdfs://master-1-1.c-6fc187819ed6bae0.cn-shanghai.emr.aliyuncs.com:9000/user/hive/warehouse'),
    name?: string(name='name', example='mms_test'),
    numRows?: long(name='numRows', example='2323'),
    owner?: string(name='owner', example='System user'),
    partitions?: int32(name='partitions', example='2000'),
    partitionsDoing?: int32(name='partitionsDoing', example='200'),
    partitionsDone?: int32(name='partitionsDone', example='1400'),
    partitionsFailed?: int32(name='partitionsFailed', example='400'),
    size?: long(name='size', example='323232332'),
    sourceId?: long(name='sourceId', example='2000017'),
    sourceName?: string(name='sourceName', example='demo'),
    status?: string(name='status', example='DOING'),
    tables?: int32(name='tables', example='200'),
    tablesDoing?: int32(name='tablesDoing', example='20'),
    tablesDone?: int32(name='tablesDone', example='120'),
    tablesFailed?: int32(name='tablesFailed', example='20'),
    tablesPartDone?: int32(name='tablesPartDone', example='20'),
    updated?: boolean(name='updated', example='true'),
  }(name='data'),
  requestId?: string(name='requestId', example='90D64EB6-2962-5B1C-A039-BC41C8176C7F'),
}

model GetMmsDbResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsDbResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsDbResponse
 */
async function getMmsDbWithOptions(sourceId: string, dbId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsDbResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsDb',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/dbs/${$URL.percentEncode(dbId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsDbResponse
 */
async function getMmsDb(sourceId: string, dbId: string): GetMmsDbResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsDbWithOptions(sourceId, dbId, headers, runtime);
}

model GetMmsFetchMetadataJobResponseBody = {
  data?: {
    endTime?: string(name='endTime', example='2024-12-16 19:10:07'),
    errorMsg?: string(name='errorMsg', example='unexpected exception'),
    id?: long(name='id', example='1000002'),
    progress?: float(name='progress', example='5000'),
    result?: string(name='result', example='{"databases":5,"tables":75,"partitions":215}'),
    sourceId?: long(name='sourceId', example='2000015'),
    startTime?: string(name='startTime', example='2024-12-16 19:09:37'),
    status?: string(name='status', example='SCAN_DOING'),
  }(name='data'),
  requestId?: string(name='requestId', example='5CA6292A-E301-5CD8-B4E2-AF060F99147B'),
}

model GetMmsFetchMetadataJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsFetchMetadataJobResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsFetchMetadataJobResponse
 */
async function getMmsFetchMetadataJobWithOptions(sourceId: string, scanId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsFetchMetadataJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsFetchMetadataJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/scans/${$URL.percentEncode(scanId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsFetchMetadataJobResponse
 */
async function getMmsFetchMetadataJob(sourceId: string, scanId: string): GetMmsFetchMetadataJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsFetchMetadataJobWithOptions(sourceId, scanId, headers, runtime);
}

model GetMmsJobResponseBody = {
  data?: {
    config?: {
      columnMapping?: map[string]string(name='columnMapping'),
      enableVerification?: boolean(name='enableVerification'),
      increment?: boolean(name='increment'),
      others?: map[string]any(name='others'),
      partitionFilters?: map[string]string(name='partitionFilters'),
      partitions?: [ long ](name='partitions'),
      schemaOnly?: boolean(name='schemaOnly'),
      tableBlackList?: [ string ](name='tableBlackList'),
      tableMapping?: map[string]string(name='tableMapping'),
      tableWhiteList?: [ string ](name='tableWhiteList'),
      tables?: [ string ](name='tables'),
      taskType?: string(name='taskType'),
      tunnelQuota?: string(name='tunnelQuota'),
    }(name='config'),
    createTime?: string(name='createTime', example='2024-12-17 15:44:17'),
    dbId?: long(name='dbId', example='23'),
    dstDbName?: string(name='dstDbName', example='mms_target'),
    dstSchemaName?: string(name='dstSchemaName', example='default'),
    eta?: string(name='eta'),
    id?: long(name='id', example='10'),
    name?: string(name='name', example='migrate_db_1'),
    sourceId?: long(name='sourceId', example='2'),
    sourceName?: string(name='sourceName', example='demo'),
    srcDbName?: string(name='srcDbName', example='mms_test'),
    srcSchemaName?: string(name='srcSchemaName', example='default'),
    status?: string(name='status', example='DOING'),
    stopped?: boolean(name='stopped', example='false'),
    taskDone?: int32(name='taskDone', example='100'),
    taskNum?: int32(name='taskNum', example='100'),
    type?: string(name='type', example='Tables'),
  }(name='data'),
  requestId?: string(name='requestId', example='D9F872FD-5DDE-30A6-8C8A-1B8C6A81059F'),
}

model GetMmsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsJobResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsJobResponse
 */
async function getMmsJobWithOptions(sourceId: string, jobId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs/${$URL.percentEncode(jobId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsJobResponse
 */
async function getMmsJob(sourceId: string, jobId: string): GetMmsJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsJobWithOptions(sourceId, jobId, headers, runtime);
}

model GetMmsPartitionResponseBody = {
  data?: {
    dbId?: long(name='DbId', example='2'),
    dbName?: string(name='dbName', example='d1'),
    id?: long(name='id', example='2323'),
    lastDdlTime?: string(name='lastDdlTime', description='lastDdlTime', example='2024-12-17 15:44:42'),
    numRows?: long(name='numRows', example='2323'),
    size?: long(name='size', example='12323'),
    sourceId?: long(name='sourceId', example='200018'),
    sourceName?: string(name='sourceName', example='demo'),
    status?: string(name='status', example='DONE'),
    tableId?: long(name='tableId', example='23'),
    tableName?: string(name='tableName', example='t1'),
    updated?: boolean(name='updated', example='false'),
    value?: string(name='value', example='p1=1/p2=abc'),
  }(name='data'),
  requestId?: string(name='requestId', example='D9F872FD-5DDE-30A6-8C8A-1B8C6A81059F'),
}

model GetMmsPartitionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsPartitionResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsPartitionResponse
 */
async function getMmsPartitionWithOptions(sourceId: string, partitionId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsPartitionResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsPartition',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/partitions/${$URL.percentEncode(partitionId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsPartitionResponse
 */
async function getMmsPartition(sourceId: string, partitionId: string): GetMmsPartitionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsPartitionWithOptions(sourceId, partitionId, headers, runtime);
}

model GetMmsTableResponseBody = {
  data?: {
    dbId?: long(name='dbId', example='3'),
    dbName?: string(name='dbName', example='mms_test'),
    extra?: string(name='extra', example='{"mapkey.delim":":","collection.delim":",","serialization.format":"|","field.delim":"|"}'),
    hasPartitions?: boolean(name='hasPartitions', example='true'),
    id?: long(name='id', description='table ID', example='22'),
    inputFormat?: string(name='inputFormat', description='inputFormat', example='org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'),
    lastDdlTime?: string(name='lastDdlTime', description='lastDdlTime', example='2024-12-17 15:44:42'),
    location?: string(name='location', example='| hdfs://master-1-1.c-c127cd184bb029ea.cn-zhangjiakou.emr.aliyuncs.com:9000/user/hive/warehouse/demo'),
    name?: string(name='name', example='test'),
    numRows?: long(name='numRows', example='233232'),
    outputFormat?: string(name='outputFormat', description='outputFormat', example='org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'),
    owner?: string(name='owner', example='Hive'),
    partitions?: int32(name='partitions', example='100'),
    partitionsDoing?: int32(name='partitionsDoing', example='20'),
    partitionsDone?: int32(name='partitionsDone', example='80'),
    partitionsFailed?: int32(name='partitionsFailed', example='0'),
    schema?: {
      columns?: [ 
        {
          comment?: string(name='comment', example='user id'),
          defaultValue?: string(name='defaultValue', example='10'),
          name?: string(name='name', example='user_id'),
          nullable?: boolean(name='nullable', example='false'),
          type?: string(name='type', example='bigint'),
        }
      ](name='columns'),
      comment?: string(name='comment', example='for mms test'),
      name?: string(name='name', example='test'),
      partitions?: [ 
        {
          comment?: string(name='comment', example='first partition level'),
          defaultValue?: string(name='defaultValue', example='abc'),
          name?: string(name='name', example='p1'),
          nullable?: boolean(name='nullable', example='false'),
          type?: string(name='type', example='string'),
        }
      ](name='partitions'),
    }(name='schema'),
    serde?: string(name='serde', description='serde', example='org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'),
    size?: long(name='size', example='23232'),
    sourceId?: long(name='sourceId', example='2000028'),
    sourceName?: string(name='sourceName', example='demo'),
    status?: string(name='status', example='DONE'),
    type?: string(name='type', example='MANAGED_TABLED'),
    updated?: boolean(name='updated', example='false'),
  }(name='data'),
  requestId?: string(name='requestId', example='E7FB14F1-4ACD-5C73-A755-B302D70AB9AD'),
}

model GetMmsTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsTableResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsTableResponse
 */
async function getMmsTableWithOptions(sourceId: string, tableId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsTableResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsTable',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/tables/${$URL.percentEncode(tableId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsTableResponse
 */
async function getMmsTable(sourceId: string, tableId: string): GetMmsTableResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsTableWithOptions(sourceId, tableId, headers, runtime);
}

model GetMmsTaskResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2024-10-25 04:21:01'),
    dbId?: long(name='dbId', example='23'),
    dstDbName?: string(name='dstDbName', example='mms_target'),
    dstSchemaName?: string(name='dstSchemaName', example='default'),
    dstTableName?: string(name='dstTableName', example='table_1'),
    endTime?: string(name='endTime', example='2024-10-25 07:21:01'),
    id?: long(name='id', example='7680'),
    jobId?: long(name='jobId', example='87'),
    jobName?: string(name='jobName', example='test_odps_spark'),
    retriedTimes?: int32(name='retriedTimes', example='1'),
    running?: boolean(name='running', example='true'),
    sourceId?: long(name='sourceId', example='2000015'),
    sourceName?: string(name='sourceName', example='demo'),
    srcDbName?: string(name='srcDbName', example='mms_test'),
    srcSchemaName?: string(name='srcSchemaName', example='default'),
    srcTableName?: string(name='srcTableName', example='table_1'),
    startTime?: string(name='startTime', example='2024-10-25 06:21:01'),
    status?: string(name='status', example='DATA_DOING'),
    stopped?: boolean(name='stopped', example='false'),
    tableId?: long(name='tableId', example='2323'),
    type?: string(name='type', example='BIGQUERY'),
  }(name='data'),
  requestId?: string(name='requestId', example='73207140-0FD5-588A-B11A-3CE093924196'),
}

model GetMmsTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetMmsTaskResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetMmsTaskResponse
 */
async function getMmsTaskWithOptions(sourceId: string, taskId: string, headers: map[string]string, runtime: $RuntimeOptions): GetMmsTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetMmsTask',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/tasks/${$URL.percentEncode(taskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return GetMmsTaskResponse
 */
async function getMmsTask(sourceId: string, taskId: string): GetMmsTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getMmsTaskWithOptions(sourceId, taskId, headers, runtime);
}

model GetPackageRequest {
  sourceProject?: string(name='sourceProject', description='The project to which the package belongs. This parameter is required if the package is installed in the MaxCompute project.', example='projectB'),
}

model GetPackageResponseBody = {
  data?: {
    allowedProjectList?: [ 
      {
        label?: string(name='label', description='The security level for sensitive data.', example='2'),
        project?: string(name='project', description='The name of the MaxCompute project.', example='proejctB'),
      }
    ](name='allowedProjectList', description='The projects in which the package is installed.'),
    resourceList?: {
      function?: [ 
        {
          actions?: [ string ](name='actions', description='The operations that were performed on the function.'),
          name?: string(name='name', description='The name of the function.', example='function_1'),
          schemaName?: string(name='schemaName', description='The name of schema.', example='default'),
        }
      ](name='function', description='The functions.'),
      resource?: [ 
        {
          actions?: [ string ](name='actions', description='The operations that were performed on the resource.'),
          name?: string(name='name', description='The name of the resource.', example='res_1'),
          schemaName?: string(name='schemaName', description='The name of schema.', example='default'),
        }
      ](name='resource', description='The resources.'),
      table?: [ 
        {
          actions?: [ string ](name='actions', description='The operations that were performed on the table.'),
          name?: string(name='name', description='The name of the table.', example='dim_odps'),
          schemaName?: string(name='schemaName', description='The name of schema.', example='default'),
        }
      ](name='table', description='The tables.'),
    }(name='resourceList', description='The details of the resources that are included in the package.'),
  }(name='data', description='The returned data.'),
  errorCode?: string(name='errorCode', description='The error code returned if the request failed.', example='040002'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='error message.'),
  httpCode?: int32(name='httpCode', description='Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0b57ff8316614119858417939e3e54'),
}

model GetPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPackageResponseBody(name='body'),
}

/**
 * @summary Obtains the information about a package.
 *
 * @param request GetPackageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPackageResponse
 */
async function getPackageWithOptions(projectName: string, packageName: string, request: GetPackageRequest, headers: map[string]string, runtime: $RuntimeOptions): GetPackageResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.sourceProject)) {
    query['sourceProject'] = request.sourceProject;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetPackage',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/packages/${$URL.percentEncode(packageName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the information about a package.
 *
 * @param request GetPackageRequest
 * @return GetPackageResponse
 */
async function getPackage(projectName: string, packageName: string, request: GetPackageRequest): GetPackageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getPackageWithOptions(projectName, packageName, request, headers, runtime);
}

model GetProjectRequest {
  verbose?: boolean(name='verbose', description='Specifies whether to use additional information.', example='true'),
}

model GetProjectResponseBody = {
  data?: {
    comment?: string(name='comment', description='The project description.', example='maxcompute project'),
    costStorage?: string(name='costStorage', description='The total storage usage. The storage space that is occupied by your project, which is the logical storage space after your project data is collected and compressed.', example='16489027'),
    createdTime?: long(name='createdTime', description='The creation time.', example='1704380838000'),
    defaultQuota?: string(name='defaultQuota', description='The default computing quota that is used to allocate computing resources. If you do not specify a computing quota for your project, the jobs that are initiated by your project consume the computing resources in the default quota. For more information about how to use computing resources, see [Use quota groups for computing resources](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/use-of-computing-resources).', example='quota_a'),
    ipWhiteList?: {
      ipList?: string(name='ipList', description='The IP address whitelist for access over the Internet or the network for interconnecting with other Alibaba Cloud services.

>  If you configure only the IP address whitelist for access over the Internet or the network for interconnecting with other Alibaba Cloud services, the access over the Internet or the network for interconnecting with other Alibaba Cloud services is subject to configurations, and access over a virtual private cloud (VPC) is not allowed.', example='10.88.111.3'),
      vpcIpList?: string(name='vpcIpList', description='The IP address whitelist for access over a VPC.

>  If you configure only the IP address whitelist for access over a VPC, the access over a VPC is subject to configurations, and the access over the Internet or the network for interconnecting with other Alibaba Cloud services is not allowed.', example='10.88.111.3'),
    }(name='ipWhiteList', description='The information about the IP address whitelist.'),
    name?: string(name='name', description='The project name.', example='odps_project'),
    owner?: string(name='owner', description='The account information of the project owner.', example='1565950907343451'),
    productType?: string(name='productType', description='The billing method of the default computing quota.', example='PayAsYouGo'),
    properties?: {
      allowFullScan?: boolean(name='allowFullScan', description='Indicates whether a full table scan is allowed in the project. A full table scan occupies a large number of resources, which reduces data processing efficiency. By default, the full table scan feature is disabled.', example='false'),
      autoMvQuotaGb?: long(name='autoMvQuotaGb'),
      elderTunnelQuota?: string(name='elderTunnelQuota', description='The Tunnel parent resource group that is bound to the project. You do not need to pay attention to this group.', example='No value'),
      enableAutoMv?: boolean(name='enableAutoMv'),
      enableDecimal2?: boolean(name='enableDecimal2', description='Indicates whether the DECIMAL type of the MaxCompute V2.0 data type edition is enabled.', example='true'),
      enableDr?: boolean(name='enableDr'),
      enableFdcCacheForce?: boolean(name='enableFdcCacheForce', description='Indicates whether external table caching is forcefully enabled.', example='true'),
      enableTieredStorage?: boolean(name='enableTieredStorage', description='Indicates whether [tiered storage](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/tiered-storage) is enabled.', example='true'),
      enableTunnelQuotaRoute?: boolean(name='enableTunnelQuotaRoute', description='Indicates whether the routing of the Tunnel resource group is enabled.

*   true: The data transfer tasks that are submitted by the project by default use the Tunnel resource group that is bound to the project.
*   false: The data transfer tasks that are submitted by the project by default use the Tunnel shared resource group.', example='true'),
      encryption?: {
        algorithm?: string(name='algorithm', description='The data encryption algorithm that is supported by the key. Valid values: AES256, AESCTR, and RC4.', example='SHA1'),
        enable?: boolean(name='enable', description='Indicates whether the data encryption feature needs to be enabled for the project. For more information about data encryption, see

[Storage encryption](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/storage-encryption).', example='true'),
        key?: string(name='key', description='The type of key that is used for data encryption. You can select MaxCompute Default Key or Bring Your Own Key (BYOK) as the key type. If you select MaxCompute Default Key, the default key that is created by MaxCompute is used.', example='dafault'),
      }(name='encryption', description='The storage encryption properties.'),
      externalProjectProperties?: {
        isExternalCatalogBound?: string(name='isExternalCatalogBound', description='Indicates whether the external project is an external project for [data lakehouse solution 2.0](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/lake-warehouse-integrated-2-0-use-guide).', example='true'),
      }(name='externalProjectProperties', description='The properties of the external project.'),
      fdcQuota?: string(name='fdcQuota', description='The quota for external table caching.', example='fdc_quota'),
      retentionDays?: long(name='retentionDays', description='The retention period for backup data. Unit: days. During the retention period, you can restore data of the version in use to the backup data of any version. Valid values: [0,30]. Default value: 1. The value 0 indicates that the backup feature is disabled.', example='1'),
      sqlMeteringMax?: string(name='sqlMeteringMax', description='The maximum consumption threshold of a single SQL statement. Formula: Amount of scanned data (GB) × Complexity.', example='1500'),
      storageTierInfo?: {
        projectBackupSize?: long(name='projectBackupSize', description='The backup storage usage.', example='86672917'),
        projectTotalSize?: long(name='projectTotalSize', description='The total storage usage.', example='56066037'),
        storageTierSize?: {
          longTermSize?: long(name='longTermSize', description='The storage usage at the long-term storage tier.', example='21764917'),
          lowFrequencySize?: long(name='lowFrequencySize', description='The storage usage at the Infrequent Access (IA) layer.', example='767693'),
          standardSize?: long(name='standardSize', description='The storage usage at the standard storage tier.', example='27649172'),
        }(name='storageTierSize', description='The [storage tier](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/tiered-storage) information.'),
      }(name='storageTierInfo', description='The [storage tier](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/tiered-storage) information.'),
      tableLifecycle?: {
        type?: string(name='type', description='The lifecycle type. Valid values:

*   **mandatory**: The lifecycle clause is required in a table creation statement.
*   **optional**: The lifecycle clause is optional in a table creation statement. If you do not configure a lifecycle for a table, the table does not expire.
*   **inherit**: If you do not configure a lifecycle for a table when you create the table, the value of the odps.table.lifecycle.value parameter is used as the table lifecycle by default.', example='optional'),
        value?: string(name='value', description='The table lifecycle. Unit: days. Valid values: 1 to 37231. Default value: 37231.', example='37231'),
      }(name='tableLifecycle', description='The table lifecycle properties.'),
      tableLifecycleConfig?: {
        tierToLongterm?: {
          daysAfterLastAccessGreaterThan?: long(name='DaysAfterLastAccessGreaterThan', description='The system triggers an automatic storage tier change N days after the last access time of data. N is specified by this parameter and corresponds to `LastAccessTime` that is configured for the table or partition.

>  If LastAccessTime of a table or partition is left empty, the following rules are applied:

*   For tables or partitions that you created before October 1, 2023, 2023.10.01 00:00:00 in UTC+0 is considered as the last access time.

*   For tables or partitions that you created on or after October 1, 2023, if no data is accessed, the table or partition creation time is considered as the last access time.', example='180'),
          daysAfterLastModificationGreaterThan?: long(name='DaysAfterLastModificationGreaterThan', description='The system triggers an automatic storage tier change N days after the last modification time of data. N is specified by this parameter and corresponds to `LastModifiedTime` that is configured for the table or partition.', example='180'),
          daysAfterLastTierModificationGreaterThan?: long(name='DaysAfterLastTierModificationGreaterThan', description='The period after the previous storage tier change time.', example='1'),
        }(name='TierToLongterm', description='The information about the long-term storage tier.'),
        tierToLowFrequency?: {
          daysAfterLastAccessGreaterThan?: long(name='DaysAfterLastAccessGreaterThan', description='The system triggers an automatic storage tier change N days after the last access time of data. N is specified by this parameter and corresponds to `LastAccessTime` that is configured for the table or partition.

>  If LastAccessTime of a table or partition is left empty, the following rules are applied:

*   For tables or partitions that you created before October 1, 2023, 2023.10.01 00:00:00 in UTC+0 is considered as the last access time.

*   For tables or partitions that you created on or after October 1, 2023, if no data is accessed, the table or partition creation time is considered as the last access time.', example='30'),
          daysAfterLastModificationGreaterThan?: long(name='DaysAfterLastModificationGreaterThan', description='The system triggers an automatic storage tier change N days after the last modification time of data. N is specified by this parameter and corresponds to `LastModifiedTime` that is configured for the table or partition.', example='30'),
          daysAfterLastTierModificationGreaterThan?: long(name='DaysAfterLastTierModificationGreaterThan', description='The period after the previous storage tier change time.', example='1'),
        }(name='TierToLowFrequency', description='The information about the IA storage tier.'),
      }(name='tableLifecycleConfig', description='The [properties of tiered storage lifecycle rules](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/tiered-storage#f61fc9db76nna). After you configure the properties, the system triggers automatic switching of storage tiers based on the rules.'),
      timezone?: string(name='timezone', description='The time zone that is used by your project. The time zone is the same as the time zone specified by `odps.sql.timezone`.', example='Asia/Shanghai'),
      tunnelQuota?: string(name='tunnelQuota', description='The [Tunnel](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/overview-of-dts) resource group that is bound to the project.

*   Default resource group: The Tunnel shared resource group is used. You cannot use the subscription-based Tunnel resource group for the project. The default resource group is automatically used by the Tunnel service of your project, regardless of the parameter setting.
*   Subscription-based Tunnel resource group: You can use the subscription-based Tunnel resource group for the project.', example='Quota'),
      typeSystem?: string(name='typeSystem', description='The data type edition. Valid values:

*   **1**: MaxCompute V1.0 data type edition
*   **2**: MaxCompute V2.0 data type edition
*   **hive**: Hive-compatible data type edition

For more information about the differences among the three data type editions, see [Data type editions](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/data-type-editions).', example='2.0'),
    }(name='properties', description='The basic properties of the project.'),
    regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
    saleTag?: {
      resourceId?: string(name='resourceId', description='The instance ID of the default computing quota.', example='project_name'),
      resourceType?: string(name='resourceType', description='The billing method of the default computing quota.', example='project'),
    }(name='saleTag', description='The instance ID and billing method of the default computing quota.'),
    securityProperties?: {
      enableDownloadPrivilege?: boolean(name='enableDownloadPrivilege', description='Indicates whether the [download control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/label-based-access-control) feature is enabled. By default, this feature is disabled.', example='false'),
      labelSecurity?: boolean(name='labelSecurity', description='Indicates whether the [label-based access control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/label-based-access-control) feature is enabled. By default, this feature is disabled.', example='false'),
      objectCreatorHasAccessPermission?: boolean(name='objectCreatorHasAccessPermission', description='Indicates whether to allow the object creator to have the access permissions on the object. The default value is true, which indicates that the object creator has the access permissions on the object.', example='true'),
      objectCreatorHasGrantPermission?: boolean(name='objectCreatorHasGrantPermission', description='Indicates whether the object creator has the authorization permissions on the object. The default value is true, which indicates that the object creator has the authorization permissions on the object.', example='true'),
      projectProtection?: {
        exceptionPolicy?: string(name='exceptionPolicy', description='If you enable the project data protection mechanism, you can configure exception or trusted projects. This allows specified users to transfer data of a specified object to a specified project. The project data protection mechanism does not take effect in all the situations that are specified in the exception policy.', example='{
    "Version": "1",
    "Statement":
    [{
        "Effect":"Allow",
        "Principal":"<Principal>",
        "Action":["odps:<Action1>[, <Action2>, ...]"],
        "Resource":"acs:odps:*:<Resource>",
        "Condition":{
            "StringEquals": {
                "odps:TaskType":["<Tasktype>"]
            }
        }
    }]
    }'),
        protected?: boolean(name='protected', description='Indicates whether the [data protection mechanism](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/project-data-protection) is enabled for the project. This allows or denies data transfer across projects. By default, the data protection mechanism is disabled.', example='true'),
      }(name='projectProtection', description='The properties of the [data protection mechanism](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/project-data-protection).'),
      usingAcl?: boolean(name='usingAcl', description='Indicates whether the [ACL-based access control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/acl-based-access-control) feature is enabled. By default, this feature is enabled.', example='true'),
      usingPolicy?: boolean(name='usingPolicy', description='Indicates whether the [policy-based access control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/policy-based-access-control-1) feature is enabled. By default, this feature is enabled.', example='true'),
    }(name='securityProperties', description='The permission properties.'),
    status?: string(name='status', description='The project status. Valid values:

*   **AVAILABLE**
*   **READONLY**
*   **FROZEN**
*   **DELETING**', example='AVAILABLE'),
    superAdmins?: [ string ](name='superAdmins', description='The list of `Super_Administrator` role members of the project.'),
    threeTierModel?: boolean(name='threeTierModel', description='Indicates whether data storage by schema is supported. MaxCompute supports the schema feature. This feature allows you to classify objects such as tables, resources, and user-defined functions (UDFs) in a project by schema. You can create multiple schemas in a project. For more information, see [Schema-related operations](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/schema-related-operations).', example='true'),
    type?: string(name='type', description='The project type. Valid values:

*   **managed**: internal project
*   **external**: external project', example='managed'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='040002'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='error message.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters and syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7b316643495896551555e855b'),
}

model GetProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectResponseBody(name='body'),
}

/**
 * @summary Queries the information about a MaxCompute project.
 *
 * @param request GetProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectResponse
 */
async function getProjectWithOptions(projectName: string, request: GetProjectRequest, headers: map[string]string, runtime: $RuntimeOptions): GetProjectResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.verbose)) {
    query['verbose'] = request.verbose;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetProject',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a MaxCompute project.
 *
 * @param request GetProjectRequest
 * @return GetProjectResponse
 */
async function getProject(projectName: string, request: GetProjectRequest): GetProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectWithOptions(projectName, request, headers, runtime);
}

model GetQuotaRequest {
  akProven?: string(name='AkProven', description='The trusted AccessKey pairs.', example='null', deprecated=true),
  mock?: boolean(name='mock', description='Specifies whether to include submodules. Valid values: -true: The request includes submodules. -false: The request does not include submodules. This is the default value.', example='false'),
  region?: string(name='region', description='The region ID.', example='cn-chengdu', deprecated=true),
  tenantId?: string(name='tenantId', description='The tenant ID.', example='520539530998273', deprecated=true),
}

model GetQuotaResponseBody = {
  billingPolicy?: {
    billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
    odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
    orderId?: string(name='orderId', description='The order ID.', example='45245678'),
  }(name='billingPolicy', description='The information about the order.'),
  cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
  createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
  creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
  data?: {
    billingPolicy?: {
      billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
      odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
      orderId?: string(name='orderId', description='The order ID.', example='45245678'),
    }(name='billingPolicy', description='The information about the order.'),
    cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
    createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
    creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
    id?: string(name='id', description='The quota ID.', example='0'),
    name?: string(name='name', description='The name of the quota.', example='quota_a'),
    nickName?: string(name='nickName', description='The alias of the quota.', example='quota_nickname'),
    parameter?: map[string]any(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
    parentId?: string(name='parentId', description='The ID of the parent resource.', example='null'),
    regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
    saleTag?: {
      resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
      resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
    }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
    scheduleInfo?: {
      currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
      currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
      nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
      nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
      oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
      onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
      operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
      timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
    }(name='scheduleInfo', description='The information about the scheduling plan.'),
    status?: string(name='status', description='The status of the resource.', example='ON'),
    subQuotaInfoList?: [ 
      {
        billingPolicy?: {
          billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
          odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
          orderId?: string(name='orderId', description='The order ID.', example='45245678'),
        }(name='billingPolicy', description='The information about the order.'),
        cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
        createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
        creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
        id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
        name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
        nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='subquotaA'),
        parameter?: {
          elasticReservedCU?: long(name='elasticReservedCU'),
          enablePriority?: boolean(name='enablePriority'),
          forceReservedMin?: boolean(name='forceReservedMin'),
          maxCU?: long(name='maxCU', description='This parameter is required.'),
          minCU?: long(name='minCU', description='This parameter is required.'),
          schedulerType?: string(name='schedulerType'),
          singleJobCULimit?: long(name='singleJobCULimit'),
        }(name='parameter', description='The description of the quota.'),
        parentId?: string(name='parentId', description='The ID of the parent resource.', example='0'),
        regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
        saleTag?: {
          resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
          resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
        }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
        scheduleInfo?: {
          currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
          currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
          nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
          nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
          oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
          onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
          operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
          timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
        }(name='scheduleInfo', description='The information about the scheduling plan.'),
        status?: string(name='status', description='The status of the resource.', example='ON'),
        tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
        tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
        type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
        version?: string(name='version', description='The version number.', example='1'),
      }
    ](name='subQuotaInfoList', description='The information about the level-2 quota.'),
    tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
    tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
    type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
    version?: string(name='version', description='The version number.', example='1'),
  }(name='data', description='The returned data.'),
  id?: string(name='id', description='The quota ID.', example='0'),
  name?: string(name='name', description='The name of the quota.', example='quota_a'),
  nickName?: string(name='nickName', description='The alias of the quota.', example='quota_nickname'),
  parameter?: map[string]any(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
  parentId?: string(name='parentId', description='The ID of the parent resource.', example='null'),
  regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7a316654730544735643e9200'),
  saleTag?: {
    resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
    resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
  }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
  scheduleInfo?: {
    currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
    currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
    nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
    nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
    oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
    onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
    operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
    timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
  }(name='scheduleInfo', description='The information about the scheduling plan.'),
  status?: string(name='status', description='The status of the resource.', example='ON'),
  subQuotaInfoList?: [ 
    {
      billingPolicy?: {
        billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
        odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
        orderId?: string(name='orderId', description='The order ID.', example='45245678'),
      }(name='billingPolicy', description='The information about the order.'),
      cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
      createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
      creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
      id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
      name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
      nickName?: string(name='nickName', description='The alias of the level-2 quota.', example='subquotaA'),
      parameter?: {
        elasticReservedCU?: long(name='elasticReservedCU'),
        enablePriority?: boolean(name='enablePriority'),
        forceReservedMin?: boolean(name='forceReservedMin'),
        maxCU?: long(name='maxCU', description='This parameter is required.'),
        minCU?: long(name='minCU', description='This parameter is required.'),
        schedulerType?: string(name='schedulerType'),
        singleJobCULimit?: long(name='singleJobCULimit'),
      }(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
      parentId?: string(name='parentId', description='The ID of the parent resource.', example='0'),
      regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
      saleTag?: {
        resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
        resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
      }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
      scheduleInfo?: {
        currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
        currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
        nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
        nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
        oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
        onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
        operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
        timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
      }(name='scheduleInfo', description='The information about the scheduling plan.'),
      status?: string(name='status', description='The status of the resource.', example='ON'),
      tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
      tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
      type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
      version?: string(name='version', description='The version number.', example='1'),
    }
  ](name='subQuotaInfoList', description='The information about the level-2 quota.'),
  tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
  tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
  type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
  version?: string(name='version', description='The version number.', example='1'),
}

model GetQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQuotaResponseBody(name='body'),
}

/**
 * @summary Obtains the information about a specified level-1 quota.
 *
 * @param request GetQuotaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQuotaResponse
 */
async function getQuotaWithOptions(nickname: string, request: GetQuotaRequest, headers: map[string]string, runtime: $RuntimeOptions): GetQuotaResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.akProven)) {
    query['AkProven'] = request.akProven;
  }
  if (!$isNull(request.mock)) {
    query['mock'] = request.mock;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetQuota',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the information about a specified level-1 quota.
 *
 * @param request GetQuotaRequest
 * @return GetQuotaResponse
 */
async function getQuota(nickname: string, request: GetQuotaRequest): GetQuotaResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getQuotaWithOptions(nickname, request, headers, runtime);
}

model GetQuotaPlanRequest {
  region?: string(name='region', description='The ID of the region.', example='cn-beijing'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='483212237127906'),
}

model GetQuotaPlanResponseBody = {
  data?: {
    createTime?: string(name='createTime', description='The time when the quota plan was created.', example='2022-05-16T06:07:45Z'),
    name?: string(name='name', description='The name of the quota plan.', example='planA'),
    quota?: {
      billingPolicy?: {
        billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
        odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
        orderId?: string(name='orderId', description='The ID of the order.', example='45245678'),
      }(name='billingPolicy', description='The information of the order.'),
      cluster?: string(name='cluster', description='The ID of the cluster.', example='AT-120N'),
      createTime?: long(name='createTime', description='The time when the quota plan was created.', example='2022-09-06T02:14:44Z'),
      creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
      id?: string(name='id', description='The ID of the quota.', example='0'),
      name?: string(name='name', description='The name of the quota.', example='quota_a'),
      nickName?: string(name='nickName', description='The alias of the quota.', example='quota_nickname'),
      parameter?: map[string]any(name='parameter', description='The description of the quota.'),
      parentId?: string(name='parentId', description='The ID of the parent resource.', example='null'),
      regionId?: string(name='regionId', description='The ID of the region.', example='cn-beijing'),
      scheduleInfo?: {
        currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
        currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
        nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
        nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
        oncePlan?: string(name='oncePlan', description='If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
        onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
        operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
      }(name='scheduleInfo', description='The information of the scheduling plan.'),
      status?: string(name='status', description='The status of the resource.', example='ON'),
      subQuotaInfoList?: [ 
        {
          billingPolicy?: {
            billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
            odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
            orderId?: string(name='orderId', description='The ID of the order.', example='45245678'),
          }(name='billingPolicy', description='The information of the order.'),
          cluster?: string(name='cluster', description='The ID of the cluster.', example='AT-120N'),
          createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
          creatorId?: string(name='creatorId', description='The ID of the user who created the quota plan.', example='672863518'),
          id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
          name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
          nickName?: string(name='nickName', description='The alias of the level-2 quota.', example='subquotaA'),
          parameter?: map[string]any(name='parameter', description='The description of the quota.'),
          parentId?: string(name='parentId', description='The ID of the parent resource.', example='0'),
          regionId?: string(name='regionId', description='The ID of the region.', example='cn-beijing'),
          scheduleInfo?: {
            currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
            currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
            nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
            nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
            oncePlan?: string(name='oncePlan', description='If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
            onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
            operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
          }(name='scheduleInfo', description='The information of the scheduling plan.'),
          status?: string(name='status', description='The status of the resource.', example='ON'),
          tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
          tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
          type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
          version?: string(name='version', description='The version number.', example='1'),
        }
      ](name='subQuotaInfoList', description='The information of the level-2 quota.'),
      tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
      tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
      type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
      version?: string(name='version', description='The version number.', example='1'),
    }(name='quota', description='The details of the quota.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0be3e0aa16667684362147582e038f'),
}

model GetQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Obtains the information of a quota plan.
 *
 * @param request GetQuotaPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQuotaPlanResponse
 */
async function getQuotaPlanWithOptions(nickname: string, planName: string, request: GetQuotaPlanRequest, headers: map[string]string, runtime: $RuntimeOptions): GetQuotaPlanResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/plans/${$URL.percentEncode(planName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the information of a quota plan.
 *
 * @param request GetQuotaPlanRequest
 * @return GetQuotaPlanResponse
 */
async function getQuotaPlan(nickname: string, planName: string, request: GetQuotaPlanRequest): GetQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getQuotaPlanWithOptions(nickname, planName, request, headers, runtime);
}

model GetQuotaScheduleRequest {
  displayTimezone?: string(name='displayTimezone', description='The time zone.', example='UTC+8'),
  region?: string(name='region', description='The ID of the region.', example='cn-beijing'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
}

model GetQuotaScheduleResponseBody = {
  data?: [ 
    {
      condition?: {
        after?: string(name='after', description='The start time when the quota plan takes effect.', example='2022-04-25T04:23:04Z'),
        at?: string(name='at', description='The time when the quota plan takes effect.', example='0900'),
      }(name='condition', description='The condition value.'),
      id?: string(name='id', description='The ID of the quota plan.', example='63'),
      operator?: string(name='operator', description='The name of the operator.', example='userA'),
      plan?: string(name='plan', description='The name of the quota plan.', example='planA'),
      timezone?: string(name='timezone', description='The time zone.', example='UTC+8'),
      type?: string(name='type', description='The type of the quota plan.', example='once'),
    }
  ](name='data', description='The returned data.'),
  errorCode?: string(name='errorCode', description='*   If the value of success was false, an error code was returned.
*   If the value of success was true, a null value was returned.', example='success'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='errorMsg'),
  httpCode?: int32(name='httpCode', description='Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc059b716696296266308790e0d3e'),
}

model GetQuotaScheduleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQuotaScheduleResponseBody(name='body'),
}

/**
 * @summary Obtains the scheduling plan for a quota plan.
 *
 * @param request GetQuotaScheduleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQuotaScheduleResponse
 */
async function getQuotaScheduleWithOptions(nickname: string, request: GetQuotaScheduleRequest, headers: map[string]string, runtime: $RuntimeOptions): GetQuotaScheduleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.displayTimezone)) {
    query['displayTimezone'] = request.displayTimezone;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetQuotaSchedule',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/schedule`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the scheduling plan for a quota plan.
 *
 * @param request GetQuotaScheduleRequest
 * @return GetQuotaScheduleResponse
 */
async function getQuotaSchedule(nickname: string, request: GetQuotaScheduleRequest): GetQuotaScheduleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getQuotaScheduleWithOptions(nickname, request, headers, runtime);
}

model GetQuotaUsageRequest {
  aggMethod?: string(name='aggMethod', description='The aggregation algorithm. For a better page experience, up to 60 points can be displayed for each metric. If you select a time range longer than 1 hour, the chart uses the average value within the range (minutes of the selected time range/60) to aggregate data by default. You can change the aggregation algorithm based on your business requirements.', example='max'),
  from?: long(name='from', description='The time when the query starts. The value is the log time that is specified when log data is written.

*   The time range that is specified in this operation is a left-closed, right-open interval. The interval includes the start time specified by the **from** parameter, but does not include the end time specified by the **to** parameter. If you set the **from** and **to** parameters to the same value, the time range is invalid and an error message is returned.
*   This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1669081045'),
  plotTypes?: [ string ](name='plotTypes', description='The types of the charts.'),
  productId?: string(name='productId', description='The quota type. Default value: ODPS.

*   ODPS: computing quota
*   TUNNEL: Tunnel quota', example='ODPS'),
  region?: string(name='region', description='The region ID.', example='cn-chengdu'),
  subQuotaNickname?: string(name='subQuotaNickname', description='The alias of the level-2 quota.', example='ot_tunnel_quota'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose Tenants > Tenant Property from the left-side navigation pane to view the tenant ID.', example='478403690625249'),
  to?: long(name='to', description='The time when the query ends. The value is the log time that is specified when log data is written.

*   The time range that is specified in this operation is a left-closed, right-open interval. The interval includes the start time specified by the **from** parameter, but does not include the end time specified by the **to** parameter. If you set the **from** and **to** parameters to the same value, the time range is invalid and an error message is returned.
*   This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1669360870'),
  yAxisTypes?: [ string ](name='yAxisTypes', description='The data metric fields.'),
}

model GetQuotaUsageShrinkRequest {
  aggMethod?: string(name='aggMethod', description='The aggregation algorithm. For a better page experience, up to 60 points can be displayed for each metric. If you select a time range longer than 1 hour, the chart uses the average value within the range (minutes of the selected time range/60) to aggregate data by default. You can change the aggregation algorithm based on your business requirements.', example='max'),
  from?: long(name='from', description='The time when the query starts. The value is the log time that is specified when log data is written.

*   The time range that is specified in this operation is a left-closed, right-open interval. The interval includes the start time specified by the **from** parameter, but does not include the end time specified by the **to** parameter. If you set the **from** and **to** parameters to the same value, the time range is invalid and an error message is returned.
*   This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1669081045'),
  plotTypesShrink?: string(name='plotTypes', description='The types of the charts.'),
  productId?: string(name='productId', description='The quota type. Default value: ODPS.

*   ODPS: computing quota
*   TUNNEL: Tunnel quota', example='ODPS'),
  region?: string(name='region', description='The region ID.', example='cn-chengdu'),
  subQuotaNickname?: string(name='subQuotaNickname', description='The alias of the level-2 quota.', example='ot_tunnel_quota'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose Tenants > Tenant Property from the left-side navigation pane to view the tenant ID.', example='478403690625249'),
  to?: long(name='to', description='The time when the query ends. The value is the log time that is specified when log data is written.

*   The time range that is specified in this operation is a left-closed, right-open interval. The interval includes the start time specified by the **from** parameter, but does not include the end time specified by the **to** parameter. If you set the **from** and **to** parameters to the same value, the time range is invalid and an error message is returned.
*   This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1669360870'),
  yAxisTypesShrink?: string(name='yAxisTypes', description='The data metric fields.'),
}

model GetQuotaUsageResponseBody = {
  data?: {
    metrics?: map[string]any(name='metrics', description='The metric results.'),
    plot?: [ 
      {
        title?: string(name='title', description='The title of the chart.', example='request'),
        type?: string(name='type', description='The type of the chart.', example='request'),
        yAxis?: [ string ](name='yAxis', description='The data metric field.'),
      }
    ](name='plot', description='The information about the chart.'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters and syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7a416652014358483492eea0b'),
}

model GetQuotaUsageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQuotaUsageResponseBody(name='body'),
}

/**
 * @summary Queries quota resource consumption information.
 *
 * @param tmpReq GetQuotaUsageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQuotaUsageResponse
 */
async function getQuotaUsageWithOptions(nickname: string, tmpReq: GetQuotaUsageRequest, headers: map[string]string, runtime: $RuntimeOptions): GetQuotaUsageResponse {
  tmpReq.validate();
  var request = new GetQuotaUsageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.plotTypes)) {
    request.plotTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.plotTypes, 'plotTypes', 'simple');
  }
  if (!$isNull(tmpReq.yAxisTypes)) {
    request.yAxisTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.yAxisTypes, 'yAxisTypes', 'simple');
  }
  var query : map[string]any = {};
  if (!$isNull(request.aggMethod)) {
    query['aggMethod'] = request.aggMethod;
  }
  if (!$isNull(request.from)) {
    query['from'] = request.from;
  }
  if (!$isNull(request.plotTypesShrink)) {
    query['plotTypes'] = request.plotTypesShrink;
  }
  if (!$isNull(request.productId)) {
    query['productId'] = request.productId;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.subQuotaNickname)) {
    query['subQuotaNickname'] = request.subQuotaNickname;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }
  if (!$isNull(request.to)) {
    query['to'] = request.to;
  }
  if (!$isNull(request.yAxisTypesShrink)) {
    query['yAxisTypes'] = request.yAxisTypesShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetQuotaUsage',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/usage`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries quota resource consumption information.
 *
 * @param request GetQuotaUsageRequest
 * @return GetQuotaUsageResponse
 */
async function getQuotaUsage(nickname: string, request: GetQuotaUsageRequest): GetQuotaUsageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getQuotaUsageWithOptions(nickname, request, headers, runtime);
}

model GetRoleAclResponseBody = {
  data?: {
    function?: [ 
      {
        actions?: [ string ](name='actions', description='The operations that were performed on the function.'),
        name?: string(name='name', description='The name of the function.', example='functionA'),
        schemaName?: string(name='schemaName', description='The Schema name.', example='default'),
      }
    ](name='function', description='The function.'),
    instance?: [ 
      {
        actions?: [ string ](name='actions', description='The operations that were performed on the instance.'),
        name?: string(name='name', description='The name of the instance.', example='instanceA'),
        schemaName?: string(name='schemaName', description='The Schema name.', example='default'),
      }
    ](name='instance', description='The instance.'),
    package?: [ 
      {
        actions?: [ string ](name='actions', description='The operations that were performed on the package.'),
        name?: string(name='name', description='The name of the package.', example='packageA'),
        schemaName?: string(name='schemaName', description='The Schema name.', example='default'),
      }
    ](name='package', description='The package.'),
    project?: [ 
      {
        actions?: [ string ](name='actions', description='The operations that were performed on the project.'),
        name?: string(name='name', description='The name of the MaxCompute project.', example='projectA'),
        schemaName?: string(name='schemaName', description='The Schema name.', example='default'),
      }
    ](name='project', description='The project.'),
    resource?: [ 
      {
        actions?: [ string ](name='actions', description='The operations that were performed on the resource.'),
        name?: string(name='name', description='The name of the resource.', example='resourceA'),
        schemaName?: string(name='schemaName', description='The Schema name.', example='default'),
      }
    ](name='resource', description='The resource.'),
    table?: [ 
      {
        actions?: [ string ](name='actions', description='The operations that were performed on the table.'),
        name?: string(name='name', description='The name of the table.', example='tableA'),
        schemaName?: string(name='schemaName', description='The Schema name.', example='default'),
      }
    ](name='table', description='The table.'),
  }(name='data', description='The returned data.'),
  errorCode?: string(name='errorCode', description='The error code returned if the request failed.', example='040002'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='error message'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0a06dc0916696898838762018e9564'),
}

model GetRoleAclResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRoleAclResponseBody(name='body'),
}

/**
 * @summary Obtains the ACL-based permissions that is granted to a project-level role.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRoleAclResponse
 */
async function getRoleAclWithOptions(projectName: string, roleName: string, headers: map[string]string, runtime: $RuntimeOptions): GetRoleAclResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRoleAcl',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/roles/${$URL.percentEncode(roleName)}/roleAcl`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the ACL-based permissions that is granted to a project-level role.
 *
 * @return GetRoleAclResponse
 */
async function getRoleAcl(projectName: string, roleName: string): GetRoleAclResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRoleAclWithOptions(projectName, roleName, headers, runtime);
}

model GetRoleAclOnObjectRequest {
  objectName?: string(name='objectName', description='The name of the object.

This parameter is required.', example='tableA'),
  objectType?: string(name='objectType', description='The type of the object.

This parameter is required.', example='table'),
}

model GetRoleAclOnObjectResponseBody = {
  data?: {
    actions?: [ string ](name='actions', description='The operations that were performed on the object.'),
  }(name='data', description='The returned data'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc1366d16686529650188023ef87f'),
}

model GetRoleAclOnObjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRoleAclOnObjectResponseBody(name='body'),
}

/**
 * @summary Obtains ACL-based permissions on an object that are granted to a project-level role.
 *
 * @param request GetRoleAclOnObjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRoleAclOnObjectResponse
 */
async function getRoleAclOnObjectWithOptions(projectName: string, roleName: string, request: GetRoleAclOnObjectRequest, headers: map[string]string, runtime: $RuntimeOptions): GetRoleAclOnObjectResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.objectName)) {
    query['objectName'] = request.objectName;
  }
  if (!$isNull(request.objectType)) {
    query['objectType'] = request.objectType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRoleAclOnObject',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/roles/${$URL.percentEncode(roleName)}/acl`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains ACL-based permissions on an object that are granted to a project-level role.
 *
 * @param request GetRoleAclOnObjectRequest
 * @return GetRoleAclOnObjectResponse
 */
async function getRoleAclOnObject(projectName: string, roleName: string, request: GetRoleAclOnObjectRequest): GetRoleAclOnObjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRoleAclOnObjectWithOptions(projectName, roleName, request, headers, runtime);
}

model GetRolePolicyResponseBody = {
  data?: string(name='data', description='The returned data.', example='{
      "Statement": [
            {
                  "Action": [
                        "odps:*"
                  ],
                  "Effect": "Allow",
                  "Resource": [
                        "acs:odps:*:projects/{projectname}/authorization/packages"
                  ]
            }
      ],
      "Version": "1"
}'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc1eeed16675342848904412e08dd'),
}

model GetRolePolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRolePolicyResponseBody(name='body'),
}

/**
 * @summary Obtains the policy that is attached to a project-level role.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRolePolicyResponse
 */
async function getRolePolicyWithOptions(projectName: string, roleName: string, headers: map[string]string, runtime: $RuntimeOptions): GetRolePolicyResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRolePolicy',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/roles/${$URL.percentEncode(roleName)}/policy`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the policy that is attached to a project-level role.
 *
 * @return GetRolePolicyResponse
 */
async function getRolePolicy(projectName: string, roleName: string): GetRolePolicyResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRolePolicyWithOptions(projectName, roleName, headers, runtime);
}

model GetRunningJobsRequest {
  from?: long(name='from', description='The time when the query starts. This parameter specifies the time when a job is submitted.

*   The time range that is specified by the **from** and **to** request parameters is a closed interval. The start time and end time are included in the range. If the value of **from** is the same as the value of **to**, the time range is invalid, and a null value is returned.
*   The value is a UNIX timestamp that represents the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1683785928'),
  jobOwnerList?: [ string ](name='jobOwnerList', description='The list of job executors.'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10. Maximum value: 20.', example='10'),
  quotaNicknameList?: [ string ](name='quotaNicknameList', description='The list of nicknames of quotas that are used by jobs.'),
  to?: long(name='to', description='The time when the query ends. This parameter specifies the time when a job is submitted.

*   The time interval that is specified by the **from** and **to** request parameters is a closed interval. The start time and end time are included in the interval. If the value of **from** is the same as the value of **to**, the interval is invalid, and a null value is returned.
*   The value is a UNIX timestamp that represents the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1683612946'),
}

model GetRunningJobsShrinkRequest {
  from?: long(name='from', description='The time when the query starts. This parameter specifies the time when a job is submitted.

*   The time range that is specified by the **from** and **to** request parameters is a closed interval. The start time and end time are included in the range. If the value of **from** is the same as the value of **to**, the time range is invalid, and a null value is returned.
*   The value is a UNIX timestamp that represents the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1683785928'),
  jobOwnerListShrink?: string(name='jobOwnerList', description='The list of job executors.'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10. Maximum value: 20.', example='10'),
  quotaNicknameListShrink?: string(name='quotaNicknameList', description='The list of nicknames of quotas that are used by jobs.'),
  to?: long(name='to', description='The time when the query ends. This parameter specifies the time when a job is submitted.

*   The time interval that is specified by the **from** and **to** request parameters is a closed interval. The start time and end time are included in the interval. If the value of **from** is the same as the value of **to**, the interval is invalid, and a null value is returned.
*   The value is a UNIX timestamp that represents the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1683612946'),
}

model GetRunningJobsResponseBody = {
  data?: {
    pageNumber?: long(name='pageNumber', description='The page number.', example='2'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    runningJobInfoList?: [ 
      {
        cuSnapshot?: double(name='cuSnapshot', description='The compute unit (CU) snapshot proportion of the job.', example='0.45'),
        instanceId?: string(name='instanceId', description='The instance ID.', example='2023050206371544gomgtp3ljcr4'),
        jobOwner?: string(name='jobOwner', description='The account that submits the job.', example='ALIYUN$xxx@test.aliyunid.com'),
        memorySnapshot?: double(name='memorySnapshot', description='The memory snapshot proportion of the job.', example='0.45'),
        progress?: double(name='progress', description='The progress of the job.', example='0'),
        project?: string(name='project', description='The name of the MaxCompute project.', example='project_20221021123044_981b'),
        quotaNickname?: string(name='quotaNickname', description='The nickname of the quota that is used by the job.', example='my_quota'),
        runningAtTime?: long(name='runningAtTime', description='The time when the job starts to run.', example='1689746864'),
        submittedAtTime?: long(name='submittedAtTime', description='The time when the job is submitted.', example='1689746864'),
      }
    ](name='runningJobInfoList', description='The list of jobs in the running state.'),
    totalCount?: long(name='totalCount', description='The total number of returned entries.', example='64'),
  }(name='data', description='The returned data.'),
  errorCode?: string(name='errorCode', description='*   If the value of success was false, an error code was returned.
*   If the value of success was true, a null value was returned.', example='success'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='0A3B1FD2006A24C8D8BE65CDAC028298'),
  httpCode?: int32(name='httpCode', description='Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc3b4ab16684833172127321e2c25'),
}

model GetRunningJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRunningJobsResponseBody(name='body'),
}

/**
 * @summary Obtains the running state data of jobs that are in the running state in a specified period of time.
 *
 * @param tmpReq GetRunningJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRunningJobsResponse
 */
async function getRunningJobsWithOptions(tmpReq: GetRunningJobsRequest, headers: map[string]string, runtime: $RuntimeOptions): GetRunningJobsResponse {
  tmpReq.validate();
  var request = new GetRunningJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.jobOwnerList)) {
    request.jobOwnerListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobOwnerList, 'jobOwnerList', 'simple');
  }
  if (!$isNull(tmpReq.quotaNicknameList)) {
    request.quotaNicknameListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.quotaNicknameList, 'quotaNicknameList', 'simple');
  }
  var query : map[string]any = {};
  if (!$isNull(request.from)) {
    query['from'] = request.from;
  }
  if (!$isNull(request.jobOwnerListShrink)) {
    query['jobOwnerList'] = request.jobOwnerListShrink;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.quotaNicknameListShrink)) {
    query['quotaNicknameList'] = request.quotaNicknameListShrink;
  }
  if (!$isNull(request.to)) {
    query['to'] = request.to;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRunningJobs',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/runningJobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the running state data of jobs that are in the running state in a specified period of time.
 *
 * @param request GetRunningJobsRequest
 * @return GetRunningJobsResponse
 */
async function getRunningJobs(request: GetRunningJobsRequest): GetRunningJobsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRunningJobsWithOptions(request, headers, runtime);
}

model GetTableInfoRequest {
  schemaName?: string(name='schemaName', description='The name of the schema to which the table or view belongs.', example='default'),
  type?: string(name='type', description='The type of the table or view that you want to view. Valid values:

*   **internal**: internal table
*   **external**: external table
*   **view**: view
*   **materializedView**: [materialize view](https://www.alibabacloud.com/help/maxcompute/user-guide/materialized-view-operations)', example='internal'),
}

model GetTableInfoResponseBody = {
  data?: {
    autoRefreshEnabled?: boolean(name='autoRefreshEnabled', description='Indicates whether the materialized view is automatically refreshed. This response parameter is returned when type is set to materializedView.', example='false'),
    clusterInfo?: {
      bucketNum?: long(name='bucketNum', description='Optional. The number of buckets in the clustered table. The value 0 indicates that the number of buckets dynamically changes when a job is running.', example='1024'),
      clusterCols?: [ string ](name='clusterCols', description='The cluster keys.'),
      clusterType?: string(name='clusterType', description='The clustering type of the table. MaxCompute supports [hash clustering](https://www.alibabacloud.com/help/maxcompute/use-cases/hash-clustering) and

[range clustering](https://www.alibabacloud.com/help/maxcompute/use-cases/range-clustering).', example='Hash'),
      sortCols?: [ 
        {
          name?: string(name='name', description='The name of the sorting field.', example='col_2'),
          order?: string(name='order', description='The sorting order.', example='DESC'),
        }
      ](name='sortCols', description='The condition by which the results are sorted.'),
    }(name='clusterInfo', description='The clustering attribute. This response parameter is returned when the table is a clustered table.'),
    comment?: string(name='comment', description='The comments of the table.', example='sale_detail'),
    createTableDDL?: string(name='createTableDDL', description='DDL statement to create a table.', example='create table if not exists sale_detail( shop_name STRING, customer_id STRING, total_price DOUBLE) partitioned by (sale_date STRING, region STRING);'),
    creationTime?: long(name='creationTime', description='The creation time.', example='2022-01-17T07:07:47Z'),
    displayName?: string(name='displayName', description='The display name.', example='project_name.schema_name.table_name'),
    fileNum?: long(name='fileNum', description='The number of file of the table.', example='200'),
    isExternalTable?: boolean(name='isExternalTable', description='Indicates whether the table is an external table. This response parameter is returned when type is set to external.', example='false'),
    isOutdated?: boolean(name='isOutdated', description='Indicates whether data of the materialized view is invalid due to changes in the data of the source table. This response parameter is returned when type is set to materializedView.', example='false'),
    lastAccessTime?: long(name='lastAccessTime', description='The time when data of the table or view was last accessed.', example='2023-11-21T02:05:56Z'),
    lastDDLTime?: long(name='lastDDLTime', description='The time when the data definition language (DDL) statement of the table or view was last modified.', example='2023-11-21T02:05:56Z'),
    lastModifiedTime?: long(name='lastModifiedTime', description='The time when data of the table or view was last modified.', example='2023-11-21T02:05:56Z'),
    lifecycle?: string(name='lifecycle', description='The lifecycle. Unit: days.', example='-1'),
    location?: string(name='location', description='The path of the external table. This response parameter is returned when type is set to external.', example='oss://oss-cn-hangzhou-internal.aliyuncs.com/oss-mc-test/Demo1/'),
    materializedView?: boolean(name='materializedView', description='Indicates whether the table or view is a [materialize view](https://www.alibabacloud.com/help/maxcompute/user-guide/materialized-view-operations).', example='false'),
    name?: string(name='name', description='The name of the table or view.', example='sale_detail'),
    nativeColumns?: [ 
      {
        comment?: string(name='comment', description='The column comments.', example='The name of shop.'),
        label?: string(name='label', description='The sensitivity-level label of the column. For more information, see [Label-based access control](https://www.alibabacloud.com/help/maxcompute/user-guide/label-based-access-control).', example='0'),
        name?: string(name='name', description='The column name.', example='shop_name'),
        type?: string(name='type', description='The column type.', example='STRING'),
      }
    ](name='nativeColumns', description='The field information.'),
    odpsPropertiesRolearn?: string(name='odpsPropertiesRolearn', description='The Alibaba Cloud Resource Name (ARN) of the role AliyunODPSDefaultRole in Resource Access Management (RAM). This response parameter is returned when type is set to external.', example='acs:ram::xxxxx:role/aliyunodpsdefaultrole'),
    odpsSqlTextOptionFlushHeader?: boolean(name='odpsSqlTextOptionFlushHeader', description='Indicates whether the table header is ignored. This response parameter is returned when type is set to external.', example='true'),
    odpsTextOptionHeaderLinesCount?: long(name='odpsTextOptionHeaderLinesCount', description='The first N rows that were ignored in the table header. This response parameter is returned when type is set to external.', example='1'),
    owner?: string(name='owner', description='The account information of the table or view owner.', example='188785396123****'),
    partitionColumns?: [ 
      {
        comment?: string(name='comment', description='The comments of the partition key column.', example='Sale date.'),
        label?: string(name='label', description='The sensitivity-level label of the column. For more information, see [Label-based access control](https://www.alibabacloud.com/help/maxcompute/user-guide/label-based-access-control).', example='0'),
        name?: string(name='name', description='The partition name.', example='sale_date'),
        type?: string(name='type', description='The partition column type.', example='STRING'),
      }
    ](name='partitionColumns', description='The information about partition key columns. This response parameter is returned only for partitioned tables.'),
    physicalSize?: long(name='physicalSize', description='The physical size of the table.', example='2763'),
    projectName?: string(name='projectName', description='The name of the project to which the table or view belongs.', example='projectA'),
    rewriteEnabled?: boolean(name='rewriteEnabled', description='Indicates whether the query rewrite operation can be performed by using the materialized view. This response parameter is returned when type is set to materializedView.', example='false'),
    schema?: string(name='schema', description='The name of the schema to which the table or the view belongs.', example='default'),
    size?: long(name='size', description='The data size of the non-partitioned table. If the table is a partitioned table, the system does not calculate the data size of the table. In this case, the value of this parameter is NULL. The PARTITIONS view includes the data size of each partition in a partitioned table. Unit: bytes.', example='5372'),
    storageHandler?: string(name='storageHandler', description='The storage handler of the external table. This response parameter is returned when type is set to external.', example='com.aliyun.odps.CsvStorageHandler'),
    tableLabel?: string(name='tableLabel', description='The sensitivity-level label of the table. For more information, see [Label-based access control](https://www.alibabacloud.com/help/maxcompute/user-guide/label-based-access-control).', example='0'),
    tablesotreTableName?: string(name='tablesotreTableName', description='The name of the Tablestore table to be accessed. This response parameter is returned when type is set to external.', example='ots_tpch_orders'),
    tablestoreColumnsMapping?: string(name='tablestoreColumnsMapping', description='The columns of the Tablestore table to be accessed, including the primary key column and attribute column. This response parameter is returned when type is set to external.', example=':o_orderkey,:o_orderdate,o_custkey,o_orderstatus,o_totalprice'),
    type?: string(name='type', description='The type of the table or view. Valid values:

*   **internal**: internal table
*   **external**: external table
*   **view**: view
*   **materializedView**: [materialize view](https://www.alibabacloud.com/help/maxcompute/user-guide/materialized-view-operations)', example='internal'),
    viewText?: string(name='viewText', description='The statement that generates the view. This response parameter is returned when type is set to view.', example='select shop_name, sum(total_price) from sale_detail group by shop_name'),
  }(name='data', description='The data returned.'),
  requestId?: string(name='requestId', description='The request ID.', example='0a06dd4516687375802853481ec9fd'),
}

model GetTableInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableInfoResponseBody(name='body'),
}

/**
 * @summary Views the information about MaxCompute internal tables, views, external tables, clustered tables, or transactional tables.
 *
 * @param request GetTableInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableInfoResponse
 */
async function getTableInfoWithOptions(projectName: string, tableName: string, request: GetTableInfoRequest, headers: map[string]string, runtime: $RuntimeOptions): GetTableInfoResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.schemaName)) {
    query['schemaName'] = request.schemaName;
  }
  if (!$isNull(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTableInfo',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/tables/${$URL.percentEncode(tableName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Views the information about MaxCompute internal tables, views, external tables, clustered tables, or transactional tables.
 *
 * @param request GetTableInfoRequest
 * @return GetTableInfoResponse
 */
async function getTableInfo(projectName: string, tableName: string, request: GetTableInfoRequest): GetTableInfoResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getTableInfoWithOptions(projectName, tableName, request, headers, runtime);
}

model GetTrustedProjectsResponseBody = {
  data?: [ string ](name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc0590416675329272834336e4387'),
}

model GetTrustedProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTrustedProjectsResponseBody(name='body'),
}

/**
 * @summary Obtains the trusted projects of the current project.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTrustedProjectsResponse
 */
async function getTrustedProjectsWithOptions(projectName: string, headers: map[string]string, runtime: $RuntimeOptions): GetTrustedProjectsResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTrustedProjects',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/trustedProjects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the trusted projects of the current project.
 *
 * @return GetTrustedProjectsResponse
 */
async function getTrustedProjects(projectName: string): GetTrustedProjectsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getTrustedProjectsWithOptions(projectName, headers, runtime);
}

model KillJobsRequest {
  body?: string(name='body', description='The request body parameters.', example='[
      {
            "instanceId": "",
            "projectName": ""
      },
      {
            "instanceId": "",
            "projectName": ""
      }
]'),
  region?: string(name='region', description='The ID of the region in which the instance resides.', example='cn-hangzhou'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
}

model KillJobsResponseBody = {
  data?: string(name='data', description='The returned data.', example='success'),
  httpCode?: int32(name='httpCode', description='Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0abb7ede16814560741256732e91b6'),
}

model KillJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillJobsResponseBody(name='body'),
}

/**
 * @summary Terminates a running job.
 *
 * @param request KillJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillJobsResponse
 */
async function killJobsWithOptions(request: KillJobsRequest, headers: map[string]string, runtime: $RuntimeOptions): KillJobsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'KillJobs',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/kill`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates a running job.
 *
 * @param request KillJobsRequest
 * @return KillJobsResponse
 */
async function killJobs(request: KillJobsRequest): KillJobsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return killJobsWithOptions(request, headers, runtime);
}

model ListComputeMetricsByInstanceRequest {
  endDate?: long(name='endDate', description='The end time for the period.', example='1718590596556'),
  instanceId?: string(name='instanceId', description='The job(instance) ID.', example='20240730****ddlr'),
  jobOwner?: string(name='jobOwner', description='The Alibaba Cloud account that is used to run the MaxCompute job.', example='ALIYUN$7632***@aliyun.com'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
  projectNames?: [ string ](name='projectNames', description='The name of MaxCompute project.'),
  region?: string(name='region', description='The region ID.', example='cn-hangzhou'),
  signature?: string(name='signature', description='The signature of the SQL job.', example='ghijkl789012'),
  specCodes?: [ string ](name='specCodes', description='Specification types.'),
  startDate?: long(name='startDate', description='The start time for the period.', example='1715393576201'),
  types?: [ string ](name='types', description='Metering types.'),
}

model ListComputeMetricsByInstanceResponseBody = {
  data?: {
    instanceComputeMetrics?: [ 
      {
        endTime?: long(name='endTime', description='The end time of the job execution.', example='1710432000000'),
        instanceId?: string(name='instanceId', description='The job(instance) ID.', example='20240730****ddlr'),
        jobOwner?: string(name='jobOwner', description='The owner of the job.', example='ALIYUN$7632***@aliyun.com'),
        projectName?: string(name='projectName', description='The name of the project.', example='odps_porject'),
        signature?: string(name='signature', description='The signature of the SQL job.', example='pqrs12345tuv'),
        specCode?: string(name='specCode', description='Specifications Type, specifies the resource package that you select when you purchase the MaxCompute service.
- OdpsStandard: the pay-as-you-go resource package.

- OdpsSpot: the pay-as-you-go spot resource package.', example='OdpsStandard'),
        submitTime?: long(name='submitTime', description='The submission time of the job.', example='1610432000000'),
        type?: string(name='type', description='Metering types.
- ComputationSql: the metering data of SQL jobs that involve internal tables.

- ComputationSqlOTS: the metering data of SQL jobs that involve Tablestore external tables.

- ComputationSqlOSS: the metering data of SQL jobs that involve OSS external tables.

- MapReduce: the metering data of MapReduce jobs.

- spark: the metering data of Spark jobs.

- mars: the metering data of Mars jobs.', example='ComputationSql'),
        unit?: string(name='unit', description='The unit of computing resource usage', example='GB'),
        usage?: double(name='usage', description='The computing resource usage is calculated based on the following items:

- Amount of scanned data in the unit of GB. For the jobs whose metering types are ComputationSql, ComputationSqlOTS, or ComputationSqlOSS, they are billed based on the amount of scanned data. The computing resource usage of such a job is calculated by using the following formula: Amount of scanned data × Complexity. The complexity is fixed at 1 for the jobs whose metering types are ComputationSqlOTS or ComputationSqlOSS.

- CU-hours. For the jobs whose metering types are MapReduce, spark, or mars, they are billed based on CU-hours.', example='1024'),
      }
    ](name='instanceComputeMetrics', description='List of pay-as-you-go job compute usage.'),
    pageNumber?: long(name='pageNumber', description='The current page number.', example='1'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='totalCount', description='The total number of results returned.', example='64'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc059b717363029839908920ea631'),
}

model ListComputeMetricsByInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListComputeMetricsByInstanceResponseBody(name='body'),
}

/**
 * @summary Get compute usage of pay-as-you-go jobs.
 *
 * @param request ListComputeMetricsByInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListComputeMetricsByInstanceResponse
 */
async function listComputeMetricsByInstanceWithOptions(request: ListComputeMetricsByInstanceRequest, headers: map[string]string, runtime: $RuntimeOptions): ListComputeMetricsByInstanceResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.endDate)) {
    body['endDate'] = request.endDate;
  }
  if (!$isNull(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!$isNull(request.jobOwner)) {
    body['jobOwner'] = request.jobOwner;
  }
  if (!$isNull(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.projectNames)) {
    body['projectNames'] = request.projectNames;
  }
  if (!$isNull(request.region)) {
    body['region'] = request.region;
  }
  if (!$isNull(request.signature)) {
    body['signature'] = request.signature;
  }
  if (!$isNull(request.specCodes)) {
    body['specCodes'] = request.specCodes;
  }
  if (!$isNull(request.startDate)) {
    body['startDate'] = request.startDate;
  }
  if (!$isNull(request.types)) {
    body['types'] = request.types;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListComputeMetricsByInstance',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/computeMetrics/listByInstance`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get compute usage of pay-as-you-go jobs.
 *
 * @param request ListComputeMetricsByInstanceRequest
 * @return ListComputeMetricsByInstanceResponse
 */
async function listComputeMetricsByInstance(request: ListComputeMetricsByInstanceRequest): ListComputeMetricsByInstanceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listComputeMetricsByInstanceWithOptions(request, headers, runtime);
}

model ListComputeQuotaPlanResponseBody = {
  data?: {
    planList?: [ 
      {
        createTime?: string(name='createTime', description='The time when the quota plan was created.', example='1731394621890'),
        name?: string(name='name', description='The name of the quota plan.', example='planA'),
        quota?: {
          cluster?: string(name='cluster', description='Cluster ID.', example='AT-120N'),
          createTime?: long(name='createTime', description='The time when the level-1 quota was created.', example='1730247361356'),
          creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
          id?: string(name='id', description='The ID of the level-1 quota.', example='186'),
          name?: string(name='name', description='The name of the level-1 quota.', example='dp_cn_hangzhou_1717465943_p'),
          nickName?: string(name='nickName', description='The nickname of the level-1 quota.', example='os_MyQuota_p'),
          parameter?: {
            elasticReservedCU?: long(name='elasticReservedCU'),
            maxCU?: long(name='maxCU'),
            minCU?: long(name='minCU'),
          }(name='parameter', description='The description of the level-1 quota.', example='{
  "enablePriority": false,
  "minCU": 25,
  "adhocCU": 0,
  "elasticReservedCU": 0,
  "forceReservedMin": false,
  "maxCU": 50,
  "schedulerType": "Fifo"
}'),
          regionId?: string(name='regionId', description='Region ID.', example='cn-beijing'),
          status?: string(name='status', description='Resource status.', example='ON'),
          subQuotaInfoList?: [ 
            {
              cluster?: string(name='cluster', description='Cluster ID.', example='AT-120N'),
              createTime?: long(name='createTime', description='The creation time.', example='1730946421757'),
              creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
              id?: string(name='id', description='The ID of the level-2 quota.', example='6790'),
              name?: string(name='name', description='The name of the level-2 quota.', example='dp_cn_shanghai_1702627945_p'),
              nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='os_MyQuota'),
              parameter?: {
                elasticReservedCU?: long(name='elasticReservedCU'),
                maxCU?: long(name='maxCU'),
                minCU?: long(name='minCU'),
              }(name='parameter', description='The description of the level-2 quota.', example='{
  "enablePriority": false,
  "minCU": 25,
  "adhocCU": 0,
  "elasticReservedCU": 0,
  "forceReservedMin": false,
  "maxCU": 50,
  "schedulerType": "Fifo"
}'),
              regionId?: string(name='regionId', description='Region ID.', example='cn-beijing'),
              status?: string(name='status', description='Resource status.', example='ON'),
              tenantId?: string(name='tenantId', description='Tenant ID.', example='478403690625249'),
              type?: string(name='type', description='The type of quota.', example='FUXI_ONLINE'),
              version?: string(name='version', description='The version number.', example='2056'),
            }
          ](name='subQuotaInfoList', description='The list of subquotas.'),
          tenantId?: string(name='tenantId', description='Tenant ID.', example='478403690625249'),
          type?: string(name='type', description='The type of quota.', example='FUXI_ONLINE'),
          version?: string(name='version', description='The version number.', example='2056'),
        }(name='quota', description='The details of the quota.'),
      }
    ](name='planList', description='The list of quota plan.'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0bc3b4ae16685836687916212e7850'),
}

model ListComputeQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListComputeQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Get computeQuotaPlan list.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListComputeQuotaPlanResponse
 */
async function listComputeQuotaPlanWithOptions(nickname: string, headers: map[string]string, runtime: $RuntimeOptions): ListComputeQuotaPlanResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListComputeQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaPlan`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get computeQuotaPlan list.
 *
 * @return ListComputeQuotaPlanResponse
 */
async function listComputeQuotaPlan(nickname: string): ListComputeQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listComputeQuotaPlanWithOptions(nickname, headers, runtime);
}

model ListFunctionsRequest {
  marker?: string(name='marker', description='Specifies the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
  maxItem?: int32(name='maxItem', description='The maximum number of entries to return on each page.', example='10'),
  prefix?: string(name='prefix', description='The names of the returned resources. The names must start with the value specified by the prefix parameter. If the prefix parameter is set to a, the names of the returned resources must start with a.', example='a'),
  schemaName?: string(name='schemaName', description='the name of schema.', example='default'),
}

model ListFunctionsResponseBody = {
  data?: {
    functions?: [ 
      {
        class?: string(name='class', description='The class in which the function was defined.', example='abc'),
        creationTime?: long(name='creationTime', description='The time when the function was created. Unit: milliseconds.', example='1664505167000'),
        displayName?: string(name='displayName', description='The display name of the function.', example='getdate'),
        name?: string(name='name', description='The name of the function.', example='getdate'),
        owner?: string(name='owner', description='The owner of the function.', example='odpsowner'),
        resources?: string(name='resources', description='The name of the resource that was associated with the function.', example='abc'),
        schema?: string(name='schema', description='The schema of the function.', example='abc'),
      }
    ](name='functions', description='The information about each function.'),
    marker?: string(name='marker', description='Indicates the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
    maxItem?: int32(name='maxItem', description='The maximum number of entries returned per page.', example='10'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0be3e0b716671885050924814e3623'),
}

model ListFunctionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFunctionsResponseBody(name='body'),
}

/**
 * @summary Obtains functions in a MaxCompute project.
 *
 * @param request ListFunctionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFunctionsResponse
 */
async function listFunctionsWithOptions(projectName: string, request: ListFunctionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListFunctionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.marker)) {
    query['marker'] = request.marker;
  }
  if (!$isNull(request.maxItem)) {
    query['maxItem'] = request.maxItem;
  }
  if (!$isNull(request.prefix)) {
    query['prefix'] = request.prefix;
  }
  if (!$isNull(request.schemaName)) {
    query['schemaName'] = request.schemaName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListFunctions',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/functions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains functions in a MaxCompute project.
 *
 * @param request ListFunctionsRequest
 * @return ListFunctionsResponse
 */
async function listFunctions(projectName: string, request: ListFunctionsRequest): ListFunctionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listFunctionsWithOptions(projectName, request, headers, runtime);
}

model ListJobInfosRequest {
  ascOrder?: boolean(name='ascOrder', description='Specifies whether to sort query results in ascending or descending order.', example='true'),
  extNodeIdList?: [ string ](name='extNodeIdList', description='The ancestor node IDs.'),
  from?: long(name='from', description='The start timestamp.

This parameter is required.', example='1672112000'),
  instanceIdList?: [ string ](name='instanceIdList', description='The job instance IDs.'),
  jobOwnerList?: [ string ](name='jobOwnerList', description='The job owners.'),
  priorityList?: [ long ](name='priorityList', description='The job priorities.'),
  projectList?: [ string ](name='projectList', description='The project names.'),
  quotaNickname?: string(name='quotaNickname', description='The quota nickname.', example='quota_nickname'),
  sceneTagList?: [ string ](name='sceneTagList', description='The intelligent diagnostics tags.'),
  signatureList?: [ string ](name='signatureList', description='The job signatures.'),
  sortByList?: [ string ](name='sortByList', description='The sorting columns.'),
  sortOrderList?: [ string ](name='sortOrderList', description='The orders for the sorting columns.'),
  statusList?: [ string ](name='statusList', description='The job states.'),
  to?: long(name='to', description='The end timestamp.

This parameter is required.', example='1672112130'),
  typeList?: [ string ](name='typeList', description='The job types.'),
  orderColumn?: string(name='orderColumn', description='The column based on which you want to sort query results.', example='cuUsage'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
  region?: string(name='region', description='The region ID.', example='cn-shanghai'),
  tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
}

model ListJobInfosResponseBody = {
  data?: {
    jobInfoList?: [ 
      {
        cluster?: string(name='cluster', description='The cluster ID.', example='AY20A'),
        cuSnapshot?: double(name='cuSnapshot', description='The CU snapshot proportion of the job.', example='0.48'),
        cuUsage?: long(name='cuUsage', description='The total number of used compute units (CUs).', example='10'),
        endAtTime?: long(name='endAtTime', description='The time when the job stops running.', example='0'),
        extNodeId?: string(name='extNodeId', description='The node ID of DataWorks.', example='node_4'),
        extNodeOnDuty?: string(name='extNodeOnDuty', description='The account of the node owner.', example='duty_2'),
        extPlantFrom?: string(name='extPlantFrom', description='The upstream platform.', example='platform_3'),
        inputBytes?: double(name='inputBytes', description='The amount of scanned data for the job. Unit: byte.', example='1234'),
        instanceId?: string(name='instanceId', description='The instance ID.', example='20230410050036549gfmsdwf60gg'),
        jobOwner?: string(name='jobOwner', description='The account that commits the job.', example='ALIYUN$xxx@test.aliyunid.com'),
        jobType?: string(name='jobType', description='The type of the job.', example='SQL'),
        memorySnapshot?: double(name='memorySnapshot', description='The memory snapshot proportion of the job.', example='0.42'),
        memoryUsage?: long(name='memoryUsage', description='The total memory usage.', example='40'),
        priority?: long(name='priority', description='The priority of the job.', example='1'),
        project?: string(name='project', description='The name of the MaxCompute project.', example='openrec_new'),
        quotaNickname?: string(name='quotaNickname', description='The nickname of the quota that is used by the job.', example='my_quota'),
        quotaType?: string(name='quotaType', description='The type of the quota.', example='subscription'),
        region?: string(name='region', description='The region ID.', example='cn-shanghai'),
        runningAtTime?: long(name='runningAtTime', description='The time when the job starts to run.', example='1672112113'),
        runningTime?: long(name='runningTime', description='The period for which the job runs.', example='800'),
        sceneResults?: [ 
          {
            description?: string(name='description', description='The intelligent diagnostics result description.', example='This job uses annual and monthly computing resources. It may be that the job is waiting for resources due to the large amount of overall job running data, many resources requested, and low job priority. Please go to Resource Consumption to view the specific situation. You can also go to Cost Optimization to see if you need to adjust resource configuration.'),
            params?: map[string]string(name='params', description='Information about the nodes where data skew or data expansion is detected. This parameter is returned only when the diagnostics scenario is data skew or data expansion.'),
            scene?: string(name='scene', description='The intelligent diagnostics result scenario.', example='LackResource'),
            sceneTag?: string(name='sceneTag', description='The intelligent diagnostics result tag.', example='SubscriptionLackResource'),
            summary?: string(name='summary', description='The intelligent diagnostics result summary.', example='Insufficient computing resources available for the job. Click to view details.'),
            type?: string(name='type', description='The intelligent diagnostics result type.', example='warning'),
          }
        ](name='sceneResults', description='The intelligent diagnostics results.'),
        signature?: string(name='signature', description='The signature of the SQL job.', example='i094KijGrN3kOXZ74kbexB77XQY='),
        status?: string(name='status', description='The status of the job.', example='running'),
        statusSnapshot?: string(name='statusSnapshot', description='The status of the snapshot.', example='running'),
        submittedAtTime?: long(name='submittedAtTime', description='The time when the job was committed.', example='1672112013'),
        tags?: string(name='tags', description='The tags.', example='[]'),
        tenantId?: string(name='tenantId', description='The tenant ID.', example='213065738244354'),
        totalTime?: long(name='totalTime', description='The total period for which the job runs.', example='900'),
        waitingTime?: long(name='waitingTime', description='The duration for which the job waits to start.', example='100'),
      }
    ](name='jobInfoList', description='The information about the jobs.'),
    pageNumber?: long(name='pageNumber', description='The page number.', example='2'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='totalCount', description='The total number of returned entries.', example='64'),
  }(name='data', description='The data returned.'),
  httpCode?: int32(name='httpCode', description='Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0bc13a9516807484336515320e38f5'),
}

model ListJobInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobInfosResponseBody(name='body'),
}

/**
 * @summary Views a list of jobs.
 *
 * @param request ListJobInfosRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobInfosResponse
 */
async function listJobInfosWithOptions(request: ListJobInfosRequest, headers: map[string]string, runtime: $RuntimeOptions): ListJobInfosResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.ascOrder)) {
    query['ascOrder'] = request.ascOrder;
  }
  if (!$isNull(request.orderColumn)) {
    query['orderColumn'] = request.orderColumn;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.extNodeIdList)) {
    body['extNodeIdList'] = request.extNodeIdList;
  }
  if (!$isNull(request.from)) {
    body['from'] = request.from;
  }
  if (!$isNull(request.instanceIdList)) {
    body['instanceIdList'] = request.instanceIdList;
  }
  if (!$isNull(request.jobOwnerList)) {
    body['jobOwnerList'] = request.jobOwnerList;
  }
  if (!$isNull(request.priorityList)) {
    body['priorityList'] = request.priorityList;
  }
  if (!$isNull(request.projectList)) {
    body['projectList'] = request.projectList;
  }
  if (!$isNull(request.quotaNickname)) {
    body['quotaNickname'] = request.quotaNickname;
  }
  if (!$isNull(request.sceneTagList)) {
    body['sceneTagList'] = request.sceneTagList;
  }
  if (!$isNull(request.signatureList)) {
    body['signatureList'] = request.signatureList;
  }
  if (!$isNull(request.sortByList)) {
    body['sortByList'] = request.sortByList;
  }
  if (!$isNull(request.sortOrderList)) {
    body['sortOrderList'] = request.sortOrderList;
  }
  if (!$isNull(request.statusList)) {
    body['statusList'] = request.statusList;
  }
  if (!$isNull(request.to)) {
    body['to'] = request.to;
  }
  if (!$isNull(request.typeList)) {
    body['typeList'] = request.typeList;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobInfos',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Views a list of jobs.
 *
 * @param request ListJobInfosRequest
 * @return ListJobInfosResponse
 */
async function listJobInfos(request: ListJobInfosRequest): ListJobInfosResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobInfosWithOptions(request, headers, runtime);
}

model ListJobMetricRequest {
  group?: string(name='group', description='Grouping basis.

> Available values: project, quota, type, status. Meanings:
>- project: Group and aggregate by project;
>- quota: Group and aggregate by quota;
>- type: Group and aggregate by job type;
>- status: Group and aggregate by job status.', example='project'),
  metric?: string(name='metric', description='The name of observation metric.', example='num'),
  period?: long(name='period', description='The monitoring statistical period.Unit:Second(s).', example='3600'),
  project?: [ string ](name='project', description='The name of MaxCompute projects (for filtering).'),
  quota?: [ string ](name='quota', description='The nickname of computing Quota nickname used by the job (for filtering).'),
  type?: string(name='type', description='The type of observation metric.', example='total'),
  endTime?: long(name='endTime', description='The end time for the observation interval.

This parameter is required.', example='1735536322'),
  startTime?: long(name='startTime', description='The start time for the observation interval.

This parameter is required.', example='1735534322'),
}

model ListJobMetricResponseBody = {
  data?: {
    category?: string(name='category', description='The category of the metrics.', example='job'),
    metrics?: [ 
      {
        metric?: map[string]string(name='metric', description='Metric related information.'),
        values?: [[ double ]        ](name='values', description='Metric values information.'),
      }
    ](name='metrics', description='Metric details.'),
    name?: string(name='name', description='The name of observation metric.', example='num'),
    period?: long(name='period', description='The monitoring statistical period.Unit:Second(s).', example='3600'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='HTTP status code.
- 1xx: Informational response - Request received, processing continues.
- 2xx: Success - The request has been successfully received, understood, and accepted by the server.
- 3xx: Redirection - Further action must be taken to complete the request.
- 4xx: Client error - The request contains bad syntax or cannot be fulfilled.
- 5xx: Server error - The server failed to fulfill an apparently valid request.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0be3e0aa16667684362147582e038f'),
}

model ListJobMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobMetricResponseBody(name='body'),
}

/**
 * @summary Retrieve performance metrics for completed jobs.
 *
 * @param request ListJobMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobMetricResponse
 */
async function listJobMetricWithOptions(request: ListJobMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): ListJobMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.endTime)) {
    query['endTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['startTime'] = request.startTime;
  }

  var body : map[string]any = {};
  if (!$isNull(request.group)) {
    body['group'] = request.group;
  }
  if (!$isNull(request.metric)) {
    body['metric'] = request.metric;
  }
  if (!$isNull(request.period)) {
    body['period'] = request.period;
  }
  if (!$isNull(request.project)) {
    body['project'] = request.project;
  }
  if (!$isNull(request.quota)) {
    body['quota'] = request.quota;
  }
  if (!$isNull(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobMetric',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/metric`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Retrieve performance metrics for completed jobs.
 *
 * @param request ListJobMetricRequest
 * @return ListJobMetricResponse
 */
async function listJobMetric(request: ListJobMetricRequest): ListJobMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobMetricWithOptions(request, headers, runtime);
}

model ListJobSnapshotInfosRequest {
  ascOrder?: boolean(name='ascOrder', description='Specifies whether to sort data in ascending order.', example='true'),
  extNodeIdList?: [ string ](name='extNodeIdList', description='The ID of the upstream node.'),
  from?: long(name='from', description='Start timestamp.
> This parameter is invalid. The end timestamp should be the time point for the snapshot you want to view.', example='1706840714'),
  instanceIdList?: [ string ](name='instanceIdList', description='The instance ID.'),
  jobOwnerList?: [ string ](name='jobOwnerList', description='The account that commits the job.'),
  priorityList?: [ long ](name='priorityList', description='The priority of the job.'),
  projectList?: [ string ](name='projectList', description='The name of project.'),
  quotaNickname?: string(name='quotaNickname', description='The nickname of the compute Quota used by the job.', example='quota_A'),
  signatureList?: [ string ](name='signatureList', description='The signature of the SQL job.'),
  sortByList?: [ string ](name='sortByList', description='The sorting columns.'),
  sortOrderList?: [ string ](name='sortOrderList', description='The orders for the sorting columns.'),
  statusList?: [ string ](name='statusList', description='The status of jobs.'),
  to?: long(name='to', description='End timestamp.

This parameter is required.', example='1706840714'),
  typeList?: [ string ](name='typeList', description='The type of the job.'),
  orderColumn?: string(name='orderColumn', description='The sorting column.', example='cpuUsage'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
  region?: string(name='region', description='The region ID.', example='cn-chengdu'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose Tenants > Tenant Property from the left-side navigation pane to view the tenant ID.', example='478403690625249'),
}

model ListJobSnapshotInfosResponseBody = {
  data?: {
    jobInfoList?: [ 
      {
        cpuRequest?: long(name='cpuRequest', description='The CPU request amount of the job at the snapshot time point. Unit: Core.', example='200'),
        cpuUsage?: long(name='cpuUsage', description='CPU usage of the job at the snapshot time. Unit: Core.', example='100'),
        cpuUsageToRequestRatio?: double(name='cpuUsageToRequestRatio', description='The CPU satisfaction ratio of the job at the snapshot time point (cpuUsage/cpuRequest).', example='0.5'),
        extNodeId?: string(name='extNodeId', description='The ID of the upstream node.', example='76358164'),
        extNodeOnDuty?: string(name='extNodeOnDuty', description='The account ID of the task owner.', example='duty_2'),
        extPlantFrom?: string(name='extPlantFrom', description='The upstream platform.', example='Dataworks'),
        instanceId?: string(name='instanceId', description='The instance ID.', example='20241028****jkl'),
        jobOwner?: string(name='jobOwner', description='The account that commits the job.', example='ALIYUN$7632***@aliyun.com'),
        jobType?: string(name='jobType', description='The type of the job.', example='SQL'),
        maxCpuPct?: double(name='maxCpuPct', description='Not applicable.', example='-1'),
        maxMemoryPct?: double(name='maxMemoryPct', description='Not applicable.', example='-1'),
        memoryRequest?: long(name='memoryRequest', description='The Memory request amount of the job at the snapshot time point. Unit: MB.', example='409600'),
        memoryUsage?: long(name='memoryUsage', description='Memory usage of the job at the snapshot time. Unit: MB.', example='409600'),
        memoryUsageToRequestRatio?: double(name='memoryUsageToRequestRatio', description='The Memory satisfaction ratio of the job at the snapshot time point (memoryUsage/memoryRequest).', example='1'),
        minCpuPct?: double(name='minCpuPct', description='The CPU usage ratio of the annual or monthly subscription job at the snapshot time (CPU usage / (reserved CPU guarantee + elastic reserved CPU)). This parameter is not available for pay-as-you-go jobs.', example='0.6'),
        minMemoryPct?: double(name='minMemoryPct', description='The memory usage ratio of the annual or monthly subscription job at the observation time (memory usage / (reserved memory guarantee + elastic reserved memory)). This parameter is not available for pay-as-you-go jobs.', example='0.6'),
        priority?: long(name='priority', description='The priority of the job.', example='9'),
        project?: string(name='project', description='The name of the MaxCompute project.', example='projectA'),
        quotaNickname?: string(name='quotaNickname', description='The nickname of the computing Quota used by the job.', example='quota_A'),
        quotaType?: string(name='quotaType', description='The type of the quota.', example='subscription'),
        region?: string(name='region', description='The region ID.', example='cn-chengdu'),
        runningAtTime?: long(name='runningAtTime', description='The start time of the job.
> The time when the job received the first batch of computing resources.', example='1736821805'),
        runningTime?: long(name='runningTime', description='The running duration, which is the duration from the runningAtTime to the snapshotTime of the job.  Unit: seconds (s).', example='43'),
        signature?: string(name='signature', description='The signature of the SQL job.', example='signatureabc'),
        snapshotTime?: long(name='snapshotTime', description='The snapshot time.', example='1736821848'),
        status?: string(name='status', description='The snapshot status of the job.

> The snapshot status is only running.', example='running'),
        submittedAtTime?: long(name='submittedAtTime', description='The time when the job was committed.', example='1736821785'),
        tenantId?: string(name='tenantId', description='The tenant ID.', example='213065738244354'),
        totalTime?: long(name='totalTime', description='The interval from the time when the job was submitted to the snapshotTime .Unit: seconds (s).', example='63'),
        waitingTime?: long(name='waitingTime', description='The duration from the time the job is submitted to the time the job starts to run. Unit: seconds (s).', example='20'),
      }
    ](name='jobInfoList', description='The job snapshots.'),
    pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    totalCount?: long(name='totalCount', description='The total number of returned results.', example='123'),
  }(name='data', description='The returned data.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='this quota is not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7e716665825896565060e87a4'),
}

model ListJobSnapshotInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobSnapshotInfosResponseBody(name='body'),
}

/**
 * @summary Views a list of job snapshot data at a specific point in time.
 *
 * @param request ListJobSnapshotInfosRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobSnapshotInfosResponse
 */
async function listJobSnapshotInfosWithOptions(request: ListJobSnapshotInfosRequest, headers: map[string]string, runtime: $RuntimeOptions): ListJobSnapshotInfosResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.ascOrder)) {
    query['ascOrder'] = request.ascOrder;
  }
  if (!$isNull(request.orderColumn)) {
    query['orderColumn'] = request.orderColumn;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var body : map[string]any = {};
  if (!$isNull(request.extNodeIdList)) {
    body['extNodeIdList'] = request.extNodeIdList;
  }
  if (!$isNull(request.from)) {
    body['from'] = request.from;
  }
  if (!$isNull(request.instanceIdList)) {
    body['instanceIdList'] = request.instanceIdList;
  }
  if (!$isNull(request.jobOwnerList)) {
    body['jobOwnerList'] = request.jobOwnerList;
  }
  if (!$isNull(request.priorityList)) {
    body['priorityList'] = request.priorityList;
  }
  if (!$isNull(request.projectList)) {
    body['projectList'] = request.projectList;
  }
  if (!$isNull(request.quotaNickname)) {
    body['quotaNickname'] = request.quotaNickname;
  }
  if (!$isNull(request.signatureList)) {
    body['signatureList'] = request.signatureList;
  }
  if (!$isNull(request.sortByList)) {
    body['sortByList'] = request.sortByList;
  }
  if (!$isNull(request.sortOrderList)) {
    body['sortOrderList'] = request.sortOrderList;
  }
  if (!$isNull(request.statusList)) {
    body['statusList'] = request.statusList;
  }
  if (!$isNull(request.to)) {
    body['to'] = request.to;
  }
  if (!$isNull(request.typeList)) {
    body['typeList'] = request.typeList;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobSnapshotInfos',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/jobs/snapshot`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Views a list of job snapshot data at a specific point in time.
 *
 * @param request ListJobSnapshotInfosRequest
 * @return ListJobSnapshotInfosResponse
 */
async function listJobSnapshotInfos(request: ListJobSnapshotInfosRequest): ListJobSnapshotInfosResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobSnapshotInfosWithOptions(request, headers, runtime);
}

model ListMmsDataSourcesRequest {
  name?: string(name='name', example='demo'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  region?: string(name='region', example='cn-shanghai'),
  type?: string(name='type', example='BIGQUERY'),
}

model ListMmsDataSourcesResponseBody = {
  data?: {
    objectList?: [ 
      {
        agentIsOnline?: boolean(name='agentIsOnline', example='true'),
        config?: [ 
          {
            desc?: string(name='desc'),
            enums?: [ string ](name='enums'),
            group?: string(name='group', example='basic_group'),
            key?: string(name='key', example='bigquery.range.partition.migrate.type'),
            name?: string(name='name'),
            placeHolder?: string(name='placeHolder', example='Cluster or Partition'),
            required?: boolean(name='required', example='true'),
            subType?: string(name='subType', example='.keytab'),
            type?: string(name='type', example='string'),
            value?: any(name='value', example='Partition'),
          }
        ](name='config'),
        createTime?: string(name='createTime', example='2024-12-17 09:29:58'),
        dbNum?: int32(name='dbNum', example='3'),
        errMsg?: string(name='errMsg', example='unexpected exception'),
        id?: long(name='id', example='2000015'),
        lastUpdateTime?: string(name='lastUpdateTime', example='2024-12-17 15:44:17'),
        name?: string(name='name', example='demo'),
        networklink?: string(name='networklink', example='vpc-2zebqp6uojhdla46677tl:cn-beijing'),
        partitionNum?: int32(name='partitionNum', example='10000000'),
        partitionsDoingNum?: int32(name='partitionsDoingNum', example='2332'),
        partitionsDoneNum?: int32(name='partitionsDoneNum', example='23'),
        partitionsFailedNum?: int32(name='partitionsFailedNum', example='2323'),
        region?: string(name='region', example='cn-beijing'),
        scanId?: long(name='scanId', example='1000253'),
        status?: string(name='status', example='STARTED'),
        tableNum?: int32(name='tableNum', example='1000'),
        tablesDoingNum?: int32(name='tablesDoingNum', example='18'),
        tablesDoneNum?: int32(name='tablesDoneNum', example='2323'),
        tablesFailedNum?: int32(name='tablesFailedNum', example='2'),
        tablesPartDoneNum?: int32(name='tablesPartDoneNum', example='22'),
        type?: string(name='type', example='BIGQUERY'),
      }
    ](name='objectList'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='20'),
    total?: int32(name='total', example='9'),
  }(name='data'),
  requestId?: string(name='requestId', example='C1F7715F-D316-5AB6-BD02-5241083F4003'),
}

model ListMmsDataSourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsDataSourcesResponseBody(name='body'),
}

/**
 * @param request ListMmsDataSourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsDataSourcesResponse
 */
async function listMmsDataSourcesWithOptions(request: ListMmsDataSourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListMmsDataSourcesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.name)) {
    query['name'] = request.name;
  }
  if (!$isNull(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsDataSources',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListMmsDataSourcesRequest
 * @return ListMmsDataSourcesResponse
 */
async function listMmsDataSources(request: ListMmsDataSourcesRequest): ListMmsDataSourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsDataSourcesWithOptions(request, headers, runtime);
}

model ListMmsDbsRequest {
  name?: string(name='name', example='demo'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  sorter?: {
    numRows?: string(name='numRows', example='desc'),
    size?: string(name='size', example='asc'),
    updateTime?: string(name='updateTime', example='2024-12-17 15:44:17'),
  }(name='sorter'),
  status?: string(name='status', example='STARTED'),
}

model ListMmsDbsShrinkRequest {
  name?: string(name='name', example='demo'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  sorterShrink?: string(name='sorter'),
  status?: string(name='status', example='STARTED'),
}

model ListMmsDbsResponseBody = {
  data?: {
    objectList?: [ 
      {
        createTime?: string(name='createTime', example='2024-12-17 15:44:42'),
        deleted?: boolean(name='deleted', example='false'),
        description?: string(name='description', example='for mms test'),
        extra?: string(name='extra', example='{}'),
        id?: long(name='id', example='1530'),
        lastDdlTime?: string(name='lastDdlTime', description='Last DDL Time', example='2024-12-17 15:44:42'),
        location?: string(name='location', example='hdfs://master-1-1.c-6fc187819ed6bae0.cn-shanghai.emr.aliyuncs.com:9000/user/hive/warehouse'),
        name?: string(name='name', example='mms_test'),
        numRows?: long(name='numRows', example='23232'),
        owner?: string(name='owner', example='xxx@yy.com'),
        partitions?: int32(name='partitions', example='1000'),
        partitionsDoing?: int32(name='partitionsDoing', example='400'),
        partitionsDone?: int32(name='partitionsDone', example='200'),
        partitionsFailed?: int32(name='partitionsFailed', example='200'),
        size?: long(name='size', example='2342342'),
        sourceId?: long(name='sourceId', example='2000015'),
        sourceName?: string(name='sourceName', example='demo'),
        status?: string(name='status', example='DOING'),
        tables?: int32(name='tables', example='100'),
        tablesDoing?: int32(name='tablesDoing', example='20'),
        tablesDone?: int32(name='tablesDone', example='20'),
        tablesFailed?: int32(name='tablesFailed', example='20'),
        tablesPartDone?: int32(name='tablesPartDone', example='20'),
        updateTime?: string(name='updateTime', example='2024-12-17 15:44:42'),
        updated?: boolean(name='updated', example='true'),
      }
    ](name='objectList'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='13'),
  }(name='data'),
  requestId?: string(name='requestId', example='CF3F9978-260F-5204-94BE-30A4E6B54443'),
}

model ListMmsDbsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsDbsResponseBody(name='body'),
}

/**
 * @summary 获取一个数据源内“库”列表
 *
 * @param tmpReq ListMmsDbsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsDbsResponse
 */
async function listMmsDbsWithOptions(sourceId: string, tmpReq: ListMmsDbsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListMmsDbsResponse {
  tmpReq.validate();
  var request = new ListMmsDbsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.sorter)) {
    request.sorterShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sorter, 'sorter', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.name)) {
    query['name'] = request.name;
  }
  if (!$isNull(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.sorterShrink)) {
    query['sorter'] = request.sorterShrink;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsDbs',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/dbs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取一个数据源内“库”列表
 *
 * @param request ListMmsDbsRequest
 * @return ListMmsDbsResponse
 */
async function listMmsDbs(sourceId: string, request: ListMmsDbsRequest): ListMmsDbsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsDbsWithOptions(sourceId, request, headers, runtime);
}

model ListMmsJobsRequest {
  sorter?: {
    status?: string(name='status', example='desc'),
  }(name='sorter'),
  dstDbName?: string(name='dstDbName', example='mms_test'),
  dstTableName?: string(name='dstTableName', example='test_table_1'),
  name?: string(name='name', example='demo'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  srcDbName?: string(name='srcDbName', example='test_db_1'),
  srcTableName?: string(name='srcTableName', example='test_table_1'),
  status?: string(name='status', example='DOING'),
  stopped?: long(name='stopped', example='false'),
}

model ListMmsJobsResponseBody = {
  data?: {
    objectList?: [ 
      {
        config?: {
          columnMapping?: map[string]string(name='columnMapping'),
          enableVerification?: boolean(name='enableVerification'),
          increment?: boolean(name='increment'),
          others?: map[string]any(name='others'),
          partitionFilters?: map[string]string(name='partitionFilters'),
          partitions?: [ long ](name='partitions'),
          schemaOnly?: boolean(name='schemaOnly'),
          tableBlackList?: [ string ](name='tableBlackList'),
          tableMapping?: map[string]string(name='tableMapping'),
          tableWhiteList?: [ string ](name='tableWhiteList'),
          tables?: [ string ](name='tables'),
          taskType?: string(name='taskType'),
          tunnelQuota?: string(name='tunnelQuota'),
        }(name='config'),
        createTime?: string(name='createTime', example='2024-12-17 15:44:17'),
        dbId?: long(name='dbId', example='196'),
        dstDbName?: string(name='dstDbName', example='mms_test'),
        dstSchemaName?: string(name='dstSchemaName', example='test_table_1'),
        eta?: string(name='eta'),
        id?: long(name='id', example='18'),
        name?: string(name='name', example='migrate_db_1'),
        sourceId?: long(name='sourceId', example='2000015'),
        sourceName?: string(name='sourceName', example='demo'),
        srcDbName?: string(name='srcDbName', example='test_db_1'),
        srcSchemaName?: string(name='srcSchemaName', example='test_table_1'),
        status?: string(name='status', example='DONE'),
        stopped?: boolean(name='stopped', example='false'),
        taskDone?: int32(name='taskDone', example='10'),
        taskNum?: int32(name='taskNum', example='10'),
        type?: string(name='type', example='Tables'),
      }
    ](name='objectList'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  requestId?: string(name='requestId', example='1112E7C7-C65F-57A2-A7C7-3B178AA257B6'),
}

model ListMmsJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsJobsResponseBody(name='body'),
}

/**
 * @param request ListMmsJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsJobsResponse
 */
async function listMmsJobsWithOptions(sourceId: string, request: ListMmsJobsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListMmsJobsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.dstDbName)) {
    query['dstDbName'] = request.dstDbName;
  }
  if (!$isNull(request.dstTableName)) {
    query['dstTableName'] = request.dstTableName;
  }
  if (!$isNull(request.name)) {
    query['name'] = request.name;
  }
  if (!$isNull(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.srcDbName)) {
    query['srcDbName'] = request.srcDbName;
  }
  if (!$isNull(request.srcTableName)) {
    query['srcTableName'] = request.srcTableName;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }
  if (!$isNull(request.stopped)) {
    query['stopped'] = request.stopped;
  }
  if (!$isNull(request.sorter)) {
    query['sorter'] = request.sorter;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsJobs',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListMmsJobsRequest
 * @return ListMmsJobsResponse
 */
async function listMmsJobs(sourceId: string, request: ListMmsJobsRequest): ListMmsJobsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsJobsWithOptions(sourceId, request, headers, runtime);
}

model ListMmsPartitionsRequest {
  sorter?: {
    lastDdlTime?: string(name='lastDdlTime', example='desc'),
    numRows?: string(name='numRows', example='desc'),
    size?: string(name='size', example='asc'),
  }(name='sorter'),
  dbId?: long(name='dbId', example='2'),
  dbName?: string(name='dbName', example='d1'),
  lastDdlTimeEnd?: string(name='lastDdlTimeEnd', example='2024-12-17 19:44:42'),
  lastDdlTimeStart?: string(name='lastDdlTimeStart', example='2024-12-17 15:44:42'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='100'),
  status?: [ string ](name='status'),
  tableName?: string(name='tableName', example='t1'),
  updated?: boolean(name='updated', example='false'),
  value?: string(name='value', example='p1=1/p2=abc'),
}

model ListMmsPartitionsShrinkRequest {
  sorter?: {
    lastDdlTime?: string(name='lastDdlTime', example='desc'),
    numRows?: string(name='numRows', example='desc'),
    size?: string(name='size', example='asc'),
  }(name='sorter'),
  dbId?: long(name='dbId', example='2'),
  dbName?: string(name='dbName', example='d1'),
  lastDdlTimeEnd?: string(name='lastDdlTimeEnd', example='2024-12-17 19:44:42'),
  lastDdlTimeStart?: string(name='lastDdlTimeStart', example='2024-12-17 15:44:42'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='100'),
  statusShrink?: string(name='status'),
  tableName?: string(name='tableName', example='t1'),
  updated?: boolean(name='updated', example='false'),
  value?: string(name='value', example='p1=1/p2=abc'),
}

model ListMmsPartitionsResponseBody = {
  data?: {
    objectList?: [ 
      {
        dbId?: long(name='DbId', example='2'),
        dbName?: string(name='dbName', example='d1'),
        id?: long(name='id', example='2323'),
        lastDdlTime?: string(name='lastDdlTime', description='lastDdlTime', example='2024-12-17 15:44:42'),
        numRows?: long(name='numRows', example='2323'),
        size?: long(name='size', example='23223'),
        sourceId?: long(name='sourceId', example='200018'),
        sourceName?: string(name='sourceName', example='demo'),
        status?: string(name='status', example='DONE'),
        tableId?: long(name='tableId', example='23'),
        tableName?: string(name='tableName', example='t1'),
        updated?: boolean(name='updated', example='false'),
        value?: string(name='value', example='p1=1/p2=abc'),
      }
    ](name='objectList'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='1000'),
  }(name='data'),
  requestId?: string(name='requestId', example='D9F872FD-5DDE-30A6-8C8A-1B8C6A81059F'),
}

model ListMmsPartitionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsPartitionsResponseBody(name='body'),
}

/**
 * @param tmpReq ListMmsPartitionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsPartitionsResponse
 */
async function listMmsPartitionsWithOptions(sourceId: string, tmpReq: ListMmsPartitionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListMmsPartitionsResponse {
  tmpReq.validate();
  var request = new ListMmsPartitionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.status)) {
    request.statusShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.status, 'status', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.dbId)) {
    query['dbId'] = request.dbId;
  }
  if (!$isNull(request.dbName)) {
    query['dbName'] = request.dbName;
  }
  if (!$isNull(request.lastDdlTimeEnd)) {
    query['lastDdlTimeEnd'] = request.lastDdlTimeEnd;
  }
  if (!$isNull(request.lastDdlTimeStart)) {
    query['lastDdlTimeStart'] = request.lastDdlTimeStart;
  }
  if (!$isNull(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.statusShrink)) {
    query['status'] = request.statusShrink;
  }
  if (!$isNull(request.tableName)) {
    query['tableName'] = request.tableName;
  }
  if (!$isNull(request.updated)) {
    query['updated'] = request.updated;
  }
  if (!$isNull(request.value)) {
    query['value'] = request.value;
  }
  if (!$isNull(request.sorter)) {
    query['sorter'] = request.sorter;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsPartitions',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/partitions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListMmsPartitionsRequest
 * @return ListMmsPartitionsResponse
 */
async function listMmsPartitions(sourceId: string, request: ListMmsPartitionsRequest): ListMmsPartitionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsPartitionsWithOptions(sourceId, request, headers, runtime);
}

model ListMmsTablesRequest {
  sorter?: {
    lastDdlTime?: string(name='lastDdlTime', example='desc'),
    numRows?: string(name='numRows', example='desc'),
    size?: string(name='size', example='asc'),
  }(name='sorter'),
  dbId?: long(name='dbId', example='197'),
  dbName?: string(name='dbName', example='mms_test'),
  hasPartitions?: boolean(name='hasPartitions', example='true'),
  lastDdlTimeEnd?: string(name='lastDdlTimeEnd', example='2024-12-19 15:44:42'),
  lastDdlTimeStart?: string(name='lastDdlTimeStart', example='2024-12-17 15:44:42'),
  name?: string(name='name', example='test'),
  onlyName?: boolean(name='onlyName', example='false'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  status?: [ string ](name='status'),
  type?: string(name='type', example='MANAGED_TABLE'),
}

model ListMmsTablesShrinkRequest {
  sorter?: {
    lastDdlTime?: string(name='lastDdlTime', example='desc'),
    numRows?: string(name='numRows', example='desc'),
    size?: string(name='size', example='asc'),
  }(name='sorter'),
  dbId?: long(name='dbId', example='197'),
  dbName?: string(name='dbName', example='mms_test'),
  hasPartitions?: boolean(name='hasPartitions', example='true'),
  lastDdlTimeEnd?: string(name='lastDdlTimeEnd', example='2024-12-19 15:44:42'),
  lastDdlTimeStart?: string(name='lastDdlTimeStart', example='2024-12-17 15:44:42'),
  name?: string(name='name', example='test'),
  onlyName?: boolean(name='onlyName', example='false'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  statusShrink?: string(name='status'),
  type?: string(name='type', example='MANAGED_TABLE'),
}

model ListMmsTablesResponseBody = {
  data?: {
    objectList?: [ 
      {
        dbId?: long(name='dbId', example='196'),
        dbName?: string(name='dbName', example='demo'),
        extra?: string(name='extra', example='{"mapkey.delim":":","collection.delim":",","serialization.format":"|","field.delim":"|"}'),
        hasPartitions?: boolean(name='hasPartitions', example='true'),
        id?: long(name='id', description='table ID', example='1003476'),
        inputFormat?: string(name='inputFormat', description='inputFormat', example='org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'),
        lastDdlTime?: string(name='lastDdlTime', description='lastDdlTime', example='2024-12-17 15:44:42'),
        location?: string(name='location', example='| hdfs://master-1-1.c-c127cd184bb029ea.cn-zhangjiakou.emr.aliyuncs.com:9000/user/hive/warehouse/demo'),
        name?: string(name='name', example='test'),
        numRows?: long(name='numRows', example='232323'),
        outputFormat?: string(name='outputFormat', description='outFormat', example='org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'),
        owner?: string(name='owner', example='Hive'),
        partitions?: int32(name='partitions', example='100'),
        partitionsDoing?: int32(name='partitionsDoing', example='20'),
        partitionsDone?: int32(name='partitionsDone', example='60'),
        partitionsFailed?: int32(name='partitionsFailed', example='40'),
        schema?: {
          columns?: [ 
            {
              comment?: string(name='comment', example='user id'),
              defaultValue?: string(name='defaultValue', example='""'),
              name?: string(name='name', example='user_id'),
              nullable?: boolean(name='nullable', example='false'),
              type?: string(name='type', example='bigint'),
            }
          ](name='columns'),
          comment?: string(name='comment', example='for mms test'),
          name?: string(name='name', example='test'),
          partitions?: [ 
            {
              comment?: string(name='comment'),
              defaultValue?: string(name='defaultValue', example='abc'),
              name?: string(name='name', example='p1'),
              nullable?: boolean(name='nullable', example='false'),
              type?: string(name='type', example='string'),
            }
          ](name='partitions'),
        }(name='schema'),
        serde?: string(name='serde', description='serde', example='org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'),
        size?: long(name='size', example='2985028'),
        sourceId?: long(name='sourceId', example='2000028'),
        sourceName?: string(name='sourceName', example='demo'),
        status?: string(name='status', example='DONE'),
        type?: string(name='type', example='MANAGED_TABLE'),
        updated?: boolean(name='updated', example='true'),
      }
    ](name='objectList'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='20'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  requestId?: string(name='requestId', example='E7FB14F1-4ACD-5C73-A755-B302D70AB9AD'),
}

model ListMmsTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsTablesResponseBody(name='body'),
}

/**
 * @param tmpReq ListMmsTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsTablesResponse
 */
async function listMmsTablesWithOptions(sourceId: string, tmpReq: ListMmsTablesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListMmsTablesResponse {
  tmpReq.validate();
  var request = new ListMmsTablesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.status)) {
    request.statusShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.status, 'status', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.dbId)) {
    query['dbId'] = request.dbId;
  }
  if (!$isNull(request.dbName)) {
    query['dbName'] = request.dbName;
  }
  if (!$isNull(request.hasPartitions)) {
    query['hasPartitions'] = request.hasPartitions;
  }
  if (!$isNull(request.lastDdlTimeEnd)) {
    query['lastDdlTimeEnd'] = request.lastDdlTimeEnd;
  }
  if (!$isNull(request.lastDdlTimeStart)) {
    query['lastDdlTimeStart'] = request.lastDdlTimeStart;
  }
  if (!$isNull(request.name)) {
    query['name'] = request.name;
  }
  if (!$isNull(request.onlyName)) {
    query['onlyName'] = request.onlyName;
  }
  if (!$isNull(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.statusShrink)) {
    query['status'] = request.statusShrink;
  }
  if (!$isNull(request.type)) {
    query['type'] = request.type;
  }
  if (!$isNull(request.sorter)) {
    query['sorter'] = request.sorter;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsTables',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/tables`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListMmsTablesRequest
 * @return ListMmsTablesResponse
 */
async function listMmsTables(sourceId: string, request: ListMmsTablesRequest): ListMmsTablesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsTablesWithOptions(sourceId, request, headers, runtime);
}

model ListMmsTaskLogsResponseBody = {
  data?: [ 
    {
      action?: string(name='action', example='create schema if not exists mms_test.default;'),
      createTime?: string(name='createTime', example='2024-12-17 15:44:00'),
      id?: long(name='id', example='10000'),
      msg?: string(name='msg', example='ok'),
      sourceId?: long(name='sourceId', example='2000015'),
      status?: string(name='status', example='DATA_DOING'),
      taskId?: long(name='taskId', example='4023'),
    }
  ](name='data'),
  requestId?: string(name='requestId', example='A3AE5649-EF90-54BD-86D0-C632FA950988'),
}

model ListMmsTaskLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsTaskLogsResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsTaskLogsResponse
 */
async function listMmsTaskLogsWithOptions(sourceId: string, taskId: string, headers: map[string]string, runtime: $RuntimeOptions): ListMmsTaskLogsResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsTaskLogs',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/tasks/${$URL.percentEncode(taskId)}/logs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return ListMmsTaskLogsResponse
 */
async function listMmsTaskLogs(sourceId: string, taskId: string): ListMmsTaskLogsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsTaskLogsWithOptions(sourceId, taskId, headers, runtime);
}

model ListMmsTasksRequest {
  sorter?: {
    startTime?: string(name='startTime', example='desc'),
    status?: string(name='status', example='asc'),
  }(name='sorter'),
  dstDbName?: string(name='dstDbName', example='mms_test'),
  dstTableName?: string(name='dstTableName', example='test_table_1'),
  jobId?: long(name='jobId', example='10'),
  jobName?: string(name='jobName', example='test1'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  partition?: string(name='partition', example='p1=1/p2=abc'),
  srcDbName?: string(name='srcDbName', example='test_db_1'),
  srcTableName?: string(name='srcTableName', example='test_table_1'),
  status?: string(name='status', example='DATA_DOING'),
}

model ListMmsTasksResponseBody = {
  data?: {
    objectList?: [ 
      {
        createTime?: string(name='createTime', example='2024-10-25 04:21:01'),
        dbId?: long(name='dbId', example='196'),
        dstDbName?: string(name='dstDbName', example='mms_test'),
        dstSchemaName?: string(name='dstSchemaName', example='default'),
        dstTableName?: string(name='dstTableName', example='table_1'),
        endTime?: string(name='endTime', example='2024-10-25 07:21:01'),
        id?: long(name='id', example='2323'),
        jobId?: long(name='jobId', example='87'),
        jobName?: string(name='jobName', example='test_odps_spark'),
        retriedTimes?: int32(name='retriedTimes', example='1'),
        running?: boolean(name='running', example='true'),
        sourceId?: long(name='sourceId', example='2000028'),
        sourceName?: string(name='sourceName', example='demo'),
        srcDbName?: string(name='srcDbName', example='db_1'),
        srcSchemaName?: string(name='srcSchemaName', example='default'),
        srcTableName?: string(name='srcTableName', example='table_1'),
        startTime?: string(name='startTime', example='2024-10-25 06:21:01'),
        status?: string(name='status', example='DATA_DOING'),
        stopped?: boolean(name='stopped', example='false'),
        tableId?: long(name='tableId', example='23'),
        type?: string(name='type', example='BIGQUERY'),
      }
    ](name='objectList'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  requestId?: string(name='requestId', example='373A5CB2-8570-53BE-A98F-729B11D7A8B0'),
}

model ListMmsTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMmsTasksResponseBody(name='body'),
}

/**
 * @param request ListMmsTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMmsTasksResponse
 */
async function listMmsTasksWithOptions(sourceId: string, request: ListMmsTasksRequest, headers: map[string]string, runtime: $RuntimeOptions): ListMmsTasksResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.dstDbName)) {
    query['dstDbName'] = request.dstDbName;
  }
  if (!$isNull(request.dstTableName)) {
    query['dstTableName'] = request.dstTableName;
  }
  if (!$isNull(request.jobId)) {
    query['jobId'] = request.jobId;
  }
  if (!$isNull(request.jobName)) {
    query['jobName'] = request.jobName;
  }
  if (!$isNull(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.partition)) {
    query['partition'] = request.partition;
  }
  if (!$isNull(request.srcDbName)) {
    query['srcDbName'] = request.srcDbName;
  }
  if (!$isNull(request.srcTableName)) {
    query['srcTableName'] = request.srcTableName;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }
  if (!$isNull(request.sorter)) {
    query['sorter'] = request.sorter;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListMmsTasks',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/tasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListMmsTasksRequest
 * @return ListMmsTasksResponse
 */
async function listMmsTasks(sourceId: string, request: ListMmsTasksRequest): ListMmsTasksResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listMmsTasksWithOptions(sourceId, request, headers, runtime);
}

model ListPackagesResponseBody = {
  data?: {
    createdPackages?: [ 
      {
        createTime?: long(name='createTime', description='The time when the package was created.', example='2022-08-02T02:30:34Z'),
        name?: string(name='name', description='The name of the package.', example='packageA'),
      }
    ](name='createdPackages', description='The packages that were created.'),
    installedPackages?: [ 
      {
        installTime?: long(name='installTime', description='The time when the package was installed.', example='2022-09-02T02:30:34Z'),
        name?: string(name='name', description='The name of the package.', example='packageB'),
        sourceProject?: string(name='sourceProject', description='The project to which the package belongs. This parameter is required if the package is installed in the MaxCompute project.', example='projectB'),
        status?: string(name='status', description='The status of the package.', example='OK'),
      }
    ](name='installedPackages', description='The packages that were installed.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc3b4aa16677927210252786e4cb6'),
}

model ListPackagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPackagesResponseBody(name='body'),
}

/**
 * @summary Queries the packages in a MaxCompute project.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPackagesResponse
 */
async function listPackagesWithOptions(projectName: string, headers: map[string]string, runtime: $RuntimeOptions): ListPackagesResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPackages',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/packages`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the packages in a MaxCompute project.
 *
 * @return ListPackagesResponse
 */
async function listPackages(projectName: string): ListPackagesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listPackagesWithOptions(projectName, headers, runtime);
}

model ListProjectUsersResponseBody = {
  data?: {
    users?: [ 
      {
        name?: string(name='name', description='The name of the user.', example='userA'),
      }
    ](name='users', description='An array that contains users.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7b316643495896551555e855b'),
}

model ListProjectUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectUsersResponseBody(name='body'),
}

/**
 * @summary Queries a list of users in a project.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectUsersResponse
 */
async function listProjectUsersWithOptions(projectName: string, headers: map[string]string, runtime: $RuntimeOptions): ListProjectUsersResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListProjectUsers',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/users`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of users in a project.
 *
 * @return ListProjectUsersResponse
 */
async function listProjectUsers(projectName: string): ListProjectUsersResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectUsersWithOptions(projectName, headers, runtime);
}

model ListProjectsRequest {
  listSystemCatalog?: boolean(name='listSystemCatalog', description='Specifies whether to list the built-in **SYSTEM_CATALOG** projects that are used to provide data such as project metadata and historical usage data. For more information, see [Tenant-level Information Schema](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/tenant-level-information-schema).

Valid values:

*   true: The built-in SYSTEM_CATALOG projects are listed.
*   false: The built-in SYSTEM_CATALOG projects are not listed.', example='true'),
  marker?: string(name='marker', description='The maximum number of entries to return on each page.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
  maxItem?: int32(name='maxItem', description='The maximum number of entries per page. Default value: 10.', example='10'),
  prefix?: string(name='prefix', description='Specifies the marker after which the returned list begins.', example='a'),
  quotaName?: string(name='quotaName', description='The quota name that is automatically generated. You can log on to the [MaxCompute console](https://maxcompute.console.aliyun.com), choose **Workspace** > **Quotas** from the left-side navigation pane, and then view the quota name on the **Quotas** page.', example='"hsajkdgbkaubh"'),
  quotaNickName?: string(name='quotaNickName', description='The quota nickname. You can log on to the [MaxCompute console](https://maxcompute.console.aliyun.com), choose **Workspace** > **Quotas** from the left-side navigation pane, and then view the quota nickname on the **Quotas** page.', example='quotaA'),
  region?: string(name='region', description='The region ID.', example='cn-beijing'),
  saleTags?: string(name='saleTags', description='The instance ID and billing method of the default computing quota.', example='"aaaa-bbbb"'),
  tenantId?: string(name='tenantId', description='The tenant ID. You can log on to the [MaxCompute console](https://maxcompute.console.aliyun.com), and choose **Tenants** > **Tenant Property** from the left-side navigation pane to view the tenant ID.', example='549532154333697'),
  type?: string(name='type', description='The project type. Valid values:

*   **managed**: internal project
*   **external**: external project', example='"managed"'),
}

model ListProjectsResponseBody = {
  data?: {
    nextToken?: string(name='NextToken', description='A pagination token. Only continuous page turning is supported. If NextToken is not empty, the next page exists. The value of NextToken can be used in the next request to retrieve a new page of results.', example='AAAAAV3MpHK1AP0pfERHZN5pu6kvikyUl3ChyRxN+qLPvtOb'),
    marker?: string(name='marker', description='Indicates the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
    maxItem?: int32(name='maxItem', description='The maximum number of entries returned per page.', example='10'),
    projects?: [ 
      {
        comment?: string(name='comment', description='The project description.', example='maxcompute projects'),
        costStorage?: string(name='costStorage', description='The total storage usage. The storage space that is occupied by your project, which is the logical storage space after your project data is collected and compressed.', example='16489027'),
        createdTime?: long(name='createdTime', description='The creation time.', example='1704380838000'),
        defaultQuota?: string(name='defaultQuota', description='The default computing quota that is used to allocate computing resources. If you do not specify a computing quota for your project, the jobs that are initiated by your project consume the computing resources in the default quota. For more information about how to use computing resources, see [Use quota groups for computing resources](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/use-of-computing-resources)', example='quotaA'),
        ipWhiteList?: {
          ipList?: string(name='ipList', description='The IP address whitelist for access over the Internet or the network for interconnecting with other Alibaba Cloud services.

>  If you configure only the IP address whitelist for access over the Internet or the network for interconnecting with other Alibaba Cloud services, the access over the Internet or the network for interconnecting with other Alibaba Cloud services is subject to configurations, and access over a virtual private cloud (VPC) is not allowed.', example='10.88.111.3'),
          vpcIpList?: string(name='vpcIpList', description='The IP address whitelist for access over a VPC.

>  If you configure only the IP address whitelist for access over a VPC, the access over a VPC is subject to configurations, and the access over the Internet or the network for interconnecting with other Alibaba Cloud services is not allowed.', example='10.88.111.3'),
        }(name='ipWhiteList', description='The information about the IP address whitelist.'),
        name?: string(name='name', description='The name of the project.', example='odps_project'),
        owner?: string(name='owner', description='The account information of the project owner.', example='1139815775606813'),
        properties?: {
          allowFullScan?: boolean(name='allowFullScan', description='Indicates whether a full table scan is allowed in the project. A full table scan occupies a large number of resources, which reduces data processing efficiency. By default, the full table scan feature is disabled.', example='false'),
          enableDecimal2?: boolean(name='enableDecimal2', description='Indicates whether the DECIMAL type of the MaxCompute V2.0 data type edition is enabled.', example='true'),
          enableTunnelQuotaRoute?: boolean(name='enableTunnelQuotaRoute', description='Indicates whether the routing of the Tunnel resource group is enabled.

*   true: The data transfer tasks that are submitted by the project by default use the Tunnel resource group that is bound to the project.
*   false: The data transfer tasks that are submitted by the project by default use the Tunnel shared resource group.', example='true'),
          encryption?: {
            algorithm?: string(name='algorithm', description='The data encryption algorithm that is supported by the key. Valid values: AES256, AESCTR, and RC4.', example='SHA1'),
            enable?: boolean(name='enable', description='Indicates whether the data encryption feature needs to be enabled for the project. For more information about data encryption, see

[Storage encryption](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/storage-encryption).', example='true'),
            key?: string(name='key', description='The type of key that is used for data encryption. You can select MaxCompute Default Key or Bring Your Own Key (BYOK) as the key type. If you select MaxCompute Default Key, the default key that is created by MaxCompute is used.', example='dafault'),
          }(name='encryption', description='The storage encryption properties.'),
          externalProjectProperties?: {
            isExternalCatalogBound?: string(name='isExternalCatalogBound', description='Indicates whether the external project is an external project for [data lakehouse solution 2.0](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/lake-warehouse-integrated-2-0-use-guide).', example='true'),
          }(name='externalProjectProperties', description='The properties of the external project.'),
          retentionDays?: long(name='retentionDays', description='The retention period for backup data. Unit: days. During the retention period, you can restore data of the version in use to the backup data of any version. Valid values: [0,30]. Default value: 1. The value 0 indicates that the backup feature is disabled.', example='1'),
          sqlMeteringMax?: string(name='sqlMeteringMax', description='The maximum consumption threshold of a single SQL statement. Formula: Amount of scanned data (GB) × Complexity.', example='1500'),
          tableLifecycle?: {
            type?: string(name='type', description='The lifecycle type. Valid values:

*   **mandatory**: The lifecycle clause is required in a table creation statement.
*   **optional**: The lifecycle clause is optional in a table creation statement. If you do not configure a lifecycle for a table, the table does not expire.
*   **inherit**: If you do not configure a lifecycle for a table when you create the table, the value of the odps.table.lifecycle.value parameter is used as the table lifecycle by default.', example='optional'),
            value?: string(name='value', description='The table lifecycle. Unit: days. Valid values: 1 to 37231. Default value: 37231.', example='37231'),
          }(name='tableLifecycle', description='The table lifecycle properties.'),
          timezone?: string(name='timezone', description='The time zone that is used by your project. The time zone is the same as the time zone specified by `odps.sql.timezone`.', example='Asia/Shanghai'),
          tunnelQuota?: string(name='tunnelQuota', description='The [Tunnel](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/overview-of-dts) resource group that is bound to the project.

*   Default resource group: The Tunnel shared resource group is used. You cannot use the subscription-based Tunnel resource group for the project. The default resource group is automatically used by the Tunnel service of your project, regardless of the parameter setting.
*   Subscription-based Tunnel resource group: You can use the subscription-based Tunnel resource group for the project.', example='quota_tunnel'),
          typeSystem?: string(name='typeSystem', description='The data type edition. Valid values:

*   **1**: MaxCompute V1.0 data type edition
*   **2**: MaxCompute V2.0 data type edition
*   **hive**: Hive-compatible data type edition

For more information about the differences among the three data type editions, see [Data type editions](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/data-type-editions).', example='2'),
        }(name='properties', description='The basic properties of the project.'),
        regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
        saleTag?: {
          resourceId?: string(name='resourceId', description='The instance ID of the default computing quota.', example='"aaaa-bbbb"'),
          resourceType?: string(name='resourceType', description='The billing method of the default computing quota.', example='"project"'),
        }(name='saleTag', description='The instance ID and billing method of the default computing quota.'),
        securityProperties?: {
          enableDownloadPrivilege?: boolean(name='enableDownloadPrivilege', description='Indicates whether the [download control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/label-based-access-control) feature is enabled. By default, this feature is disabled.', example='false'),
          labelSecurity?: boolean(name='labelSecurity', description='Indicates whether the [label-based access control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/label-based-access-control) feature is enabled. By default, this feature is disabled.', example='false'),
          objectCreatorHasAccessPermission?: boolean(name='objectCreatorHasAccessPermission', description='Indicates whether to allow the object creator to have the access permissions on the object. The default value is true, which indicates that the object creator has the access permissions on the object.', example='true'),
          objectCreatorHasGrantPermission?: boolean(name='objectCreatorHasGrantPermission', description='Indicates whether the object creator has the authorization permissions on the object. The default value is true, which indicates that the object creator has the authorization permissions on the object.', example='true'),
          projectProtection?: {
            exceptionPolicy?: string(name='exceptionPolicy', description='If you enable the project data protection mechanism, you can configure exception or trusted projects. This allows specified users to transfer data of a specified object to a specified project. The project data protection mechanism does not take effect in all the situations that are specified in the exception policy.', example='{
      "Version": "1",
      "Statement": [
            {
                  "Effect": "Allow",
                  "Principal": "",
                  "Action": [
                        "odps:[, , ...]"
                  ],
                  "Resource": "acs:odps:*:",
                  "Condition": {
                        "StringEquals": {
                              "odps:TaskType": [
                                    ""
                              ]
                        }
                  }
            }
      ]
}'),
            protected?: boolean(name='protected', description='Indicates whether the [data protection mechanism](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/project-data-protection) is enabled for the project. This allows or denies data transfer across projects. By default, the data protection mechanism is disabled.', example='true'),
          }(name='projectProtection', description='The properties of the [data protection mechanism](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/project-data-protection).'),
          usingAcl?: boolean(name='usingAcl', description='Indicates whether the [ACL-based access control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/acl-based-access-control) feature is enabled. By default, this feature is enabled.', example='true'),
          usingPolicy?: boolean(name='usingPolicy', description='Indicates whether the [policy-based access control](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/policy-based-access-control-1) feature is enabled. By default, this feature is enabled.', example='true'),
        }(name='securityProperties', description='The permission properties.'),
        status?: string(name='status', description='The project status. Valid values:

*   **AVAILABLE**
*   **READONLY**
*   **FROZEN**
*   **DELETING**', example='AVAILABLE'),
        threeTierModel?: boolean(name='threeTierModel', description='Indicates whether data storage by schema is supported. MaxCompute supports the schema feature. This feature allows you to classify objects such as tables, resources, and user-defined functions (UDFs) in a project by schema. You can create multiple schemas in a project. For more information, see [Schema-related operations](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/schema-related-operations).

Valid values:

*   true: supported
*   false: not supported', example='true'),
        type?: string(name='type', description='The project type. Valid values:

*   **managed**: internal project
*   **external**: external project', example='managed'),
      }
    ](name='projects', description='The list of projects.'),
  }(name='data', description='The data returned.'),
  requestId?: string(name='requestId', description='The request ID.', example='0b16399216671970335563173e2340'),
}

model ListProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectsResponseBody(name='body'),
}

/**
 * @summary Queries a list of MaxCompute projects.
 *
 * @param request ListProjectsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectsResponse
 */
async function listProjectsWithOptions(request: ListProjectsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListProjectsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.listSystemCatalog)) {
    query['listSystemCatalog'] = request.listSystemCatalog;
  }
  if (!$isNull(request.marker)) {
    query['marker'] = request.marker;
  }
  if (!$isNull(request.maxItem)) {
    query['maxItem'] = request.maxItem;
  }
  if (!$isNull(request.prefix)) {
    query['prefix'] = request.prefix;
  }
  if (!$isNull(request.quotaName)) {
    query['quotaName'] = request.quotaName;
  }
  if (!$isNull(request.quotaNickName)) {
    query['quotaNickName'] = request.quotaNickName;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.saleTags)) {
    query['saleTags'] = request.saleTags;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }
  if (!$isNull(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListProjects',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of MaxCompute projects.
 *
 * @param request ListProjectsRequest
 * @return ListProjectsResponse
 */
async function listProjects(request: ListProjectsRequest): ListProjectsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectsWithOptions(request, headers, runtime);
}

model ListQuotasRequest {
  billingType?: string(name='billingType', description='The billing method of the quota.', example='subscription'),
  marker?: string(name='marker', description='Specifies the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
  maxItem?: long(name='maxItem', description='The maximum number of entries to return on each page.', example='100'),
  productId?: string(name='productId', description='The service ID.', example='ODPS', deprecated=true),
  region?: string(name='region', description='The ID of the region.', example='cn-beijing', deprecated=true),
  saleTags?: string(name='saleTags', description='The cost tag. You can filter out quota objects based on the cost tag. The cost tag is created when you tag a service.', example='{"tag":"this_is_tag_demo"}'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='280747109771520', deprecated=true),
}

model ListQuotasResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. Only continuous page turning is supported. If NextToken is not empty, the next page exists. The value of NextToken can be used in the next request to retrieve a new page of results.', example='AAAAAdDWBF2w6Olxc+cMPjUtUMo/CvPe4IK7f7kIQFrIZjyc'),
  data?: {
    nextToken?: string(name='NextToken', description='A pagination token. Only continuous page turning is supported. If NextToken is not empty, the next page exists. The value of NextToken can be used in the next request to retrieve a new page of results.', example='"abcde"'),
    marker?: string(name='marker', description='Indicates the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
    maxItem?: long(name='maxItem', description='The maximum number of entries returned per page.', example='10'),
    quotaInfoList?: [ 
      {
        tags?: [ 
          {
            tagKey?: string(name='TagKey', description='The key of the tag.', example='Department'),
            tagValue?: string(name='TagValue', description='The value of the tag.', example='a12351qHDP6YEQMt'),
          }
        ](name='Tags', description='The tags.'),
        billingPolicy?: {
          billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
          odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
          orderId?: string(name='orderId', description='The order ID.', example='45245678'),
        }(name='billingPolicy', description='The information of the order.'),
        cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
        createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
        creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
        id?: string(name='id', description='The quota ID.', example='0'),
        name?: string(name='name', description='The name of the quota.', example='quota_a'),
        nickName?: string(name='nickName', description='The alias of the quota.', example='quota_nickname'),
        parameter?: map[string]any(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
        parentId?: string(name='parentId', description='The ID of the parent resource.', example='null'),
        regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
        saleTag?: {
          resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
          resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
        }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
        scheduleInfo?: {
          currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
          currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
          nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
          nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
          oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
          onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
          operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
          timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
        }(name='scheduleInfo', description='The information of the scheduling plan.'),
        status?: string(name='status', description='The status of the endpoint group.', example='ON'),
        subQuotaInfoList?: [ 
          {
            billingPolicy?: {
              billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
              odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
              orderId?: string(name='orderId', description='The order ID.', example='45245678'),
            }(name='billingPolicy', description='The information of the order.'),
            cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
            createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
            creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
            id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
            name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
            nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='subquotaA'),
            parameter?: {
              elasticReservedCU?: long(name='elasticReservedCU'),
              enablePriority?: boolean(name='enablePriority'),
              forceReservedMin?: boolean(name='forceReservedMin'),
              maxCU?: long(name='maxCU', description='This parameter is required.'),
              minCU?: long(name='minCU', description='This parameter is required.'),
              schedulerType?: string(name='schedulerType'),
              singleJobCULimit?: long(name='singleJobCULimit'),
            }(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
            parentId?: string(name='parentId', description='The ID of the parent resource.', example='0'),
            regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
            saleTag?: {
              resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
              resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
            }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
            scheduleInfo?: {
              currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
              currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
              nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
              nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
              oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
              onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
              operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
              timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
            }(name='scheduleInfo', description='The information of the scheduling plan.'),
            status?: string(name='status', description='The status of the endpoint group.', example='ON'),
            tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
            tenantId?: string(name='tenantId', description='The tenant ID.', example='280747109771520'),
            type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
            version?: string(name='version', description='The version of the algorithm image.', example='1'),
          }
        ](name='subQuotaInfoList', description='The information of the level-2 quota.'),
        tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
        tenantId?: string(name='tenantId', description='The tenant ID.', example='280747109771520'),
        type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
        version?: string(name='version', description='The version number.', example='1'),
      }
    ](name='quotaInfoList', description='The list of quotas.'),
  }(name='data', description='The returned data.'),
  marker?: string(name='marker', description='Indicates the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
  maxItem?: long(name='maxItem', description='The maximum number of entries returned per page.', example='10'),
  quotaInfoList?: [ 
    {
      tags?: [ 
        {
          tagKey?: string(name='TagKey', description='The key of the tag.', example='Department'),
          tagValue?: string(name='TagValue', description='The value of the tag.', example='1'),
        }
      ](name='Tags', description='The tags.'),
      billingPolicy?: {
        billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
        odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
        orderId?: string(name='orderId', description='The order ID.', example='45245678'),
      }(name='billingPolicy', description='The information of the order.'),
      cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
      createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
      creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
      id?: string(name='id', description='The quota ID.', example='0'),
      name?: string(name='name', description='The name of the quota.', example='quota_a'),
      nickName?: string(name='nickName', description='The alias of the quota.', example='quota_nickname'),
      parameter?: map[string]any(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
      parentId?: string(name='parentId', description='The ID of the parent resource.', example='null'),
      regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
      saleTag?: {
        resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
        resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"project"'),
      }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
      scheduleInfo?: {
        currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
        currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
        nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
        nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
        oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
        onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
        operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
        timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
      }(name='scheduleInfo', description='The information of the scheduling plan.'),
      status?: string(name='status', description='The status of the endpoint group.', example='ON'),
      subQuotaInfoList?: [ 
        {
          billingPolicy?: {
            billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
            odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
            orderId?: string(name='orderId', description='The order ID.', example='45245678'),
          }(name='billingPolicy', description='The information of the order.'),
          cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
          createTime?: long(name='createTime', description='The time when the resource was created.', example='2022-09-06T02:14:44Z'),
          creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
          id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
          name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
          nickName?: string(name='nickName', description='The alias of the level-2 quota.', example='subquotaA'),
          parameter?: {
            elasticReservedCU?: long(name='elasticReservedCU'),
            enablePriority?: boolean(name='enablePriority'),
            forceReservedMin?: boolean(name='forceReservedMin'),
            maxCU?: long(name='maxCU', description='This parameter is required.'),
            minCU?: long(name='minCU', description='This parameter is required.'),
            schedulerType?: string(name='schedulerType'),
            singleJobCULimit?: long(name='singleJobCULimit'),
          }(name='parameter', description='The description of the quota.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
          parentId?: string(name='parentId', description='The ID of the parent resource.', example='0'),
          regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
          saleTag?: {
            resourceIds?: [ string ](name='resourceIds', description='The identifier of an object in a MaxCompute quota. This identifier exists in the sales bill of Alibaba Cloud. You can use this identifier to associate the cost of a quota object with a tag.'),
            resourceType?: string(name='resourceType', description='The type of the object. Valid values: quota and project.', example='"quota"'),
          }(name='saleTag', description='The identifier of an object in a MaxCompute quota. This identifier is the same as the identifier in the sales bill of Alibaba Cloud. This parameter is used for tags.'),
          scheduleInfo?: {
            currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
            currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
            nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
            nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
            oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
            onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
            operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
            timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
          }(name='scheduleInfo', description='The information of the scheduling plan.'),
          status?: string(name='status', description='The status of the endpoint group.', example='ON'),
          tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
          tenantId?: string(name='tenantId', description='The tenant ID.', example='280747109771520'),
          type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
          version?: string(name='version', description='The version number.', example='1'),
        }
      ](name='subQuotaInfoList', description='The information of the level-2 quota.'),
      tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
      tenantId?: string(name='tenantId', description='The tenant ID.', example='280747109771520'),
      type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
      version?: string(name='version', description='The version.', example='1'),
    }
  ](name='quotaInfoList', description='The list of quotas.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc12e6f16677875480593081d2956'),
}

model ListQuotasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListQuotasResponseBody(name='body'),
}

/**
 * @summary Queries quotas.
 *
 * @param request ListQuotasRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListQuotasResponse
 */
async function listQuotasWithOptions(request: ListQuotasRequest, headers: map[string]string, runtime: $RuntimeOptions): ListQuotasResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.billingType)) {
    query['billingType'] = request.billingType;
  }
  if (!$isNull(request.marker)) {
    query['marker'] = request.marker;
  }
  if (!$isNull(request.maxItem)) {
    query['maxItem'] = request.maxItem;
  }
  if (!$isNull(request.productId)) {
    query['productId'] = request.productId;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.saleTags)) {
    query['saleTags'] = request.saleTags;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListQuotas',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries quotas.
 *
 * @param request ListQuotasRequest
 * @return ListQuotasResponse
 */
async function listQuotas(request: ListQuotasRequest): ListQuotasResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listQuotasWithOptions(request, headers, runtime);
}

model ListQuotasPlansRequest {
  region?: string(name='region', description='The ID of the region.', example='cn-beijing'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
}

model ListQuotasPlansResponseBody = {
  data?: {
    planList?: [ 
      {
        createTime?: string(name='createTime', description='The time when the quota plan was created.', example='2022-05-16T06:07:45Z'),
        name?: string(name='name', description='The name of the quota plan.', example='planA'),
        quota?: {
          billingPolicy?: {
            billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
            odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
            orderId?: string(name='orderId', description='The ID of the order.', example='45245678'),
          }(name='billingPolicy', description='The information of the order.'),
          cluster?: string(name='cluster', description='The ID of the cluster.', example='AT-120N'),
          createTime?: long(name='createTime', description='The time when the quota plan was created.', example='2022-09-06T02:14:44Z'),
          creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
          id?: string(name='id', description='The ID of the quota.', example='0'),
          name?: string(name='name', description='The name of the quota.', example='quota_a'),
          nickName?: string(name='nickName', description='The alias of the quota.', example='quota_nickname'),
          parameter?: map[string]any(name='parameter', description='The description of the quota.'),
          parentId?: string(name='parentId', description='The ID of the parent resource.', example='null'),
          regionId?: string(name='regionId', description='The ID of the region.', example='cn-beijing'),
          scheduleInfo?: {
            currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
            currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
            nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
            nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
            oncePlan?: string(name='oncePlan', description='If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
            onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
            operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
          }(name='scheduleInfo', description='The information of the scheduling plan.'),
          status?: string(name='status', description='The status of the resource.', example='ON'),
          subQuotaInfoList?: [ 
            {
              billingPolicy?: {
                billingMethod?: string(name='billingMethod', description='The billing method of the quota. Valid values:

*   subscription: a subscription quota.
*   payasyougo: a pay-as-you-go quota.', example='subscription'),
                odpsSpecCode?: string(name='odpsSpecCode', description='The specifications of the order.', example='OdpsStandard'),
                orderId?: string(name='orderId', description='The ID of the order.', example='45245678'),
              }(name='billingPolicy', description='The information of the order.'),
              cluster?: string(name='cluster', description='The ID of the cluster.', example='AT-120N'),
              createTime?: long(name='createTime', description='The time when the quota plan was created.', example='2022-09-06T02:14:44Z'),
              creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the resource.', example='672863518'),
              id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
              name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
              nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='subquotaA'),
              parameter?: map[string]any(name='parameter', description='The description of the quota.'),
              parentId?: string(name='parentId', description='The ID of the parent resource.', example='0'),
              regionId?: string(name='regionId', description='The ID of the region.', example='cn-beijing'),
              scheduleInfo?: {
                currPlan?: string(name='currPlan', description='The quota plan that takes effect based on the scheduling plan.', example='planA'),
                currTime?: string(name='currTime', description='The time when the current quota plan is scheduled.', example='0800'),
                nextPlan?: string(name='nextPlan', description='The next quota plan that will take effect based on the scheduling plan.', example='planB'),
                nextTime?: string(name='nextTime', description='The time when the next quota plan is scheduled.', example='1700'),
                oncePlan?: string(name='oncePlan', description='If the quota plan that immediately takes effect is different from the current quota plan, this parameter is not empty.', example='planC'),
                onceTime?: string(name='onceTime', description='The time when the quota plan immediately takes effect.', example='1500'),
                operatorName?: string(name='operatorName', description='The name of the operator.', example='userA'),
              }(name='scheduleInfo', description='The information of the scheduling plan.'),
              status?: string(name='status', description='The status of the resource.', example='ON'),
              tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
              tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
              type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
              version?: string(name='version', description='The version number.', example='1'),
            }
          ](name='subQuotaInfoList', description='The information of the level-2 quota.'),
          tag?: string(name='tag', description='The tag of the resource for the quota.', example='abc'),
          tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
          type?: string(name='type', description='The type of the resource system. This parameter corresponds to the resourceSystemType parameter of the cluster.', example='FUXI_ONLINE'),
          version?: string(name='version', description='The version number.', example='1'),
        }(name='quota', description='The details of the quota.'),
      }
    ](name='planList', description='The list of quota plans.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0be3e0bd16661643917136451ebf55'),
}

model ListQuotasPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListQuotasPlansResponseBody(name='body'),
}

/**
 * @summary Obtains quota plans.
 *
 * @param request ListQuotasPlansRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListQuotasPlansResponse
 */
async function listQuotasPlansWithOptions(nickname: string, request: ListQuotasPlansRequest, headers: map[string]string, runtime: $RuntimeOptions): ListQuotasPlansResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListQuotasPlans',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/plans`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains quota plans.
 *
 * @param request ListQuotasPlansRequest
 * @return ListQuotasPlansResponse
 */
async function listQuotasPlans(nickname: string, request: ListQuotasPlansRequest): ListQuotasPlansResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listQuotasPlansWithOptions(nickname, request, headers, runtime);
}

model ListResourcesRequest {
  marker?: string(name='marker', description='Specifies the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
  maxItem?: int32(name='maxItem', description='The maximum number of entries to return on each page.', example='10'),
  name?: string(name='name', description='The name of the resource.', example='res'),
  schemaName?: string(name='schemaName', description='The name of the schema.', example='default'),
}

model ListResourcesResponseBody = {
  data?: {
    marker?: string(name='marker', description='Indicates the marker after which the returned list begins.', example='ZmN0X21vbnRoX3Rhb2Jhb19pbmRleCE='),
    maxItem?: int32(name='maxItem', description='The maximum number of entries returned per page.', example='10'),
    resources?: [ 
      {
        comment?: string(name='comment', description='The remarks.', example='file'),
        contentMD5?: string(name='contentMD5', description='The Base64-encoded 128-bit MD5 hash value of the HTTP request body.', example='MACiECZtnLiNkNS1v5****=1'),
        creationTime?: long(name='creationTime', description='The time when the resource was created.', example='2022-01-29T03:34:09Z'),
        displayName?: string(name='displayName', description='The display name.', example='res_1'),
        lastModifiedTime?: long(name='lastModifiedTime', description='The time when the resource was modified.', example='2023-04-18T06:15:05Z'),
        lastUpdator?: string(name='lastUpdator', description='The user who updated the resource.', example='ALIYUN$xxx@test.aliyunid.com'),
        name?: string(name='name', description='The name of the resource.', example='res_1'),
        owner?: string(name='owner', description='The owner of the resource.', example='1265860483008101'),
        schema?: string(name='schema', description='The schema to which the resource belongs.', example='schemaA'),
        size?: long(name='size', description='The size of the resource.', example='10'),
        type?: string(name='type', description='The resource type.

Valid values:

*   file

    <!-- -->

    <!-- -->

    <!-- -->

*   py

    <!-- -->

    <!-- -->

    <!-- -->

*   jar

    <!-- -->

    <!-- -->

    <!-- -->

*   volumefile

    <!-- -->

    <!-- -->

    <!-- -->

*   table

    <!-- -->

    <!-- -->

    <!-- -->', example='file'),
      }
    ](name='resources', description='The list of resources.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc3b4ae16685836687916212e7850'),
}

model ListResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourcesResponseBody(name='body'),
}

/**
 * @summary Obtains resources in a MaxCompute project.
 *
 * @param request ListResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourcesResponse
 */
async function listResourcesWithOptions(projectName: string, request: ListResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListResourcesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.marker)) {
    query['marker'] = request.marker;
  }
  if (!$isNull(request.maxItem)) {
    query['maxItem'] = request.maxItem;
  }
  if (!$isNull(request.name)) {
    query['name'] = request.name;
  }
  if (!$isNull(request.schemaName)) {
    query['schemaName'] = request.schemaName;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListResources',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/resources`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains resources in a MaxCompute project.
 *
 * @param request ListResourcesRequest
 * @return ListResourcesResponse
 */
async function listResources(projectName: string, request: ListResourcesRequest): ListResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listResourcesWithOptions(projectName, request, headers, runtime);
}

model ListRolesResponseBody = {
  data?: {
    roles?: [ 
      {
        acl?: {
          function?: [ 
            {
              actions?: [ string ](name='actions', description='The operations that were performed on the function.'),
              name?: string(name='name', description='The name of the function.', example='functionA'),
            }
          ](name='function', description='The function.'),
          instance?: [ 
            {
              actions?: [ string ](name='actions', description='The operations that were performed on the instance.'),
              name?: string(name='name', description='The name of the instance.', example='instanceA'),
            }
          ](name='instance', description='The instance.'),
          package?: [ 
            {
              actions?: [ string ](name='actions', description='The operations that were performed on the package.'),
              name?: string(name='name', description='The name of the package.', example='packageA'),
            }
          ](name='package', description='The package.'),
          project?: [ 
            {
              actions?: [ string ](name='actions', description='The operations that were performed on the project.'),
              name?: string(name='name', description='The name of the MaxCompute project.', example='projectA'),
            }
          ](name='project', description='The project.'),
          resource?: [ 
            {
              actions?: [ string ](name='actions', description='The operations that were performed on the resource.'),
              name?: string(name='name', description='The name of the resource.', example='resourceA'),
            }
          ](name='resource', description='The resource.'),
          table?: [ 
            {
              actions?: [ string ](name='actions', description='The operations that were performed on the table.'),
              name?: string(name='name', description='The name of the table.', example='tableA'),
            }
          ](name='table', description='The table.'),
        }(name='acl', description='The ACL-based permissions that are granted to the role.'),
        name?: string(name='name', description='The name of the role.', example='roleA'),
        policy?: string(name='policy', description='The policy that is attached to the role.', example='{
      "Statement": [
            {
                  "Action": [
                        "odps:*"
                  ],
                  "Effect": "Allow",
                  "Resource": [
                        "acs:odps:*:projects/{projectname}/authorization/packages"
                  ]
            }
      ],
      "Version": "1"
}'),
        type?: string(name='type', description='The type of the role.', example='admin'),
      }
    ](name='roles', description='The MaxCompute project-level roles.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0a06dfe716686526652451361e80ae'),
}

model ListRolesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRolesResponseBody(name='body'),
}

/**
 * @summary Obtains MaxCompute project-level roles.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRolesResponse
 */
async function listRolesWithOptions(projectName: string, headers: map[string]string, runtime: $RuntimeOptions): ListRolesResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRoles',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/roles`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains MaxCompute project-level roles.
 *
 * @return ListRolesResponse
 */
async function listRoles(projectName: string): ListRolesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listRolesWithOptions(projectName, headers, runtime);
}

model ListStoragePartitionsInfoRequest {
  ascOrder?: boolean(name='ascOrder', description='Specifies whether to sort data in ascending order.', example='false'),
  date?: string(name='date', description='The date on which the statistics are collected, in days. Set this parameter to a value in the YYYYMMdd format.

This parameter is required.', example='20241205'),
  orderColumn?: string(name='orderColumn', description='The sorting column.', example='totalFrequency'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10.', example='10'),
  partitionPrefix?: string(name='partitionPrefix', description='The name of the partition that you want to use for fuzzy match.', example='ds=20241201'),
  region?: string(name='region', description='The region ID.', example='cn-beijing'),
  schema?: string(name='schema', description='The name of the schema.', example='schema'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose **Tenants** > **Tenant Property** from the left-side navigation pane to view the tenant ID.', example='40713753659****'),
  types?: [ string ](name='types', description='The storage types.'),
}

model ListStoragePartitionsInfoShrinkRequest {
  ascOrder?: boolean(name='ascOrder', description='Specifies whether to sort data in ascending order.', example='false'),
  date?: string(name='date', description='The date on which the statistics are collected, in days. Set this parameter to a value in the YYYYMMdd format.

This parameter is required.', example='20241205'),
  orderColumn?: string(name='orderColumn', description='The sorting column.', example='totalFrequency'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10.', example='10'),
  partitionPrefix?: string(name='partitionPrefix', description='The name of the partition that you want to use for fuzzy match.', example='ds=20241201'),
  region?: string(name='region', description='The region ID.', example='cn-beijing'),
  schema?: string(name='schema', description='The name of the schema.', example='schema'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose **Tenants** > **Tenant Property** from the left-side navigation pane to view the tenant ID.', example='40713753659****'),
  typesShrink?: string(name='types', description='The storage types.'),
}

model ListStoragePartitionsInfoResponseBody = {
  data?: {
    date?: string(name='date', description='The date on which the statistics are collected.', example='20241205'),
    pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    storagePartitionInfoList?: [ 
      {
        fileCount?: long(name='fileCount', description='The number of files.', example='2'),
        fileSize?: double(name='fileSize', description='The storage size.', example='1'),
        fileSizeUnit?: string(name='fileSizeUnit', description='The unit of the storage size.', example='GB'),
        isPartitioned?: boolean(name='isPartitioned', description='Indicates whether the table is a partitioned table. This operation returns the partition information. You do not need to take note of this parameter.', example='false'),
        lastAccessTime?: long(name='lastAccessTime', description='The time when the partition data was last accessed.

>  The data collection method is upgraded from July 2023. If the data is not accessed after the upgrade or is accessed by using ALGO jobs or the direct read method of Hologres, the last access time cannot be collected.', example='1694589365'),
        partition?: string(name='partition', description='The partition name.', example='ds=20241201'),
        projectName?: string(name='projectName', description='The project name.', example='odps_project'),
        rate?: double(name='rate', description='The change rate of the total storage usage compared with that of the recent {$recentDays} days. No value is returned.', example='1%'),
        schemaName?: string(name='schemaName', description='The schema name.', example='schema'),
        storageType?: string(name='storageType', description='The storage type.

*   standard
*   lowfrequency
*   longterm', example='standard'),
        tableName?: string(name='tableName', description='The table name.', example='bank_data'),
        totalFrequency?: long(name='totalFrequency', description='The access frequency.

> 

*   Access behaviors include:

*   The table is used as the input table of an SQL task.
*   The table is downloaded by Tunnel.
*   The table is read by calling the Storage API. The partition granularity of the partitioned table is not available. Each time an access operation is performed, the access frequency is incremented by 1.

*   The data collection method is upgraded from July 2023. If the data is not accessed after the upgrade or is accessed by using ALGO jobs or the direct read method of Hologres, the access frequency cannot be collected.', example='10'),
        totalInputAmount?: double(name='totalInputAmount', description='The total amount of accessed data.

>  The amount of data that is read by all access behaviors.', example='1'),
        totalInputAmountUnit?: string(name='totalInputAmountUnit', description='The unit of the total amount of accessed data.', example='GB'),
        type?: string(name='type', description='The type.', example='PARTITION'),
      }
    ](name='storagePartitionInfoList', description='The partition storage information.'),
    totalCount?: long(name='totalCount', description='The total number of returned entries.', example='57'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters and syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0be3e0bd16661643917136451ebf55'),
}

model ListStoragePartitionsInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListStoragePartitionsInfoResponseBody(name='body'),
}

/**
 * @summary Queries the storage details of a specific partition in a partitioned table in a MaxCompute project.
 *
 * @param tmpReq ListStoragePartitionsInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListStoragePartitionsInfoResponse
 */
async function listStoragePartitionsInfoWithOptions(project: string, table: string, tmpReq: ListStoragePartitionsInfoRequest, headers: map[string]string, runtime: $RuntimeOptions): ListStoragePartitionsInfoResponse {
  tmpReq.validate();
  var request = new ListStoragePartitionsInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.types)) {
    request.typesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.types, 'types', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.ascOrder)) {
    query['ascOrder'] = request.ascOrder;
  }
  if (!$isNull(request.date)) {
    query['date'] = request.date;
  }
  if (!$isNull(request.orderColumn)) {
    query['orderColumn'] = request.orderColumn;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.partitionPrefix)) {
    query['partitionPrefix'] = request.partitionPrefix;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.schema)) {
    query['schema'] = request.schema;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }
  if (!$isNull(request.typesShrink)) {
    query['types'] = request.typesShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListStoragePartitionsInfo',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/observations/analysis/storage/projects/${$URL.percentEncode(project)}/tables/${$URL.percentEncode(table)}/partitionsInfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the storage details of a specific partition in a partitioned table in a MaxCompute project.
 *
 * @param request ListStoragePartitionsInfoRequest
 * @return ListStoragePartitionsInfoResponse
 */
async function listStoragePartitionsInfo(project: string, table: string, request: ListStoragePartitionsInfoRequest): ListStoragePartitionsInfoResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listStoragePartitionsInfoWithOptions(project, table, request, headers, runtime);
}

model ListStorageTablesInfoRequest {
  ascOrder?: boolean(name='ascOrder', description='Specifies whether to sort data in ascending order.', example='false'),
  date?: string(name='date', description='The date on which the statistics are collected, in days. Set this parameter to a value in the `YYYYMMdd` format.

This parameter is required.', example='20241205'),
  orderColumn?: string(name='orderColumn', description='The sorting column.', example='totalFrequency'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10.', example='10'),
  recentDays?: int32(name='recentDays', description='The number of recent days for comparison.', example='1'),
  region?: string(name='region', description='The region ID.', example='cn-beijing'),
  schema?: string(name='schema', description='The name of the schema.', example='schema'),
  tablePrefix?: string(name='tablePrefix', description='The name of the table that you want to use for fuzzy match.', example='bank'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose **Tenants** > **Tenant Property** from the left-side navigation pane to view the tenant ID.', example='28074710977****'),
  types?: [ string ](name='types', description='The storage types.'),
}

model ListStorageTablesInfoShrinkRequest {
  ascOrder?: boolean(name='ascOrder', description='Specifies whether to sort data in ascending order.', example='false'),
  date?: string(name='date', description='The date on which the statistics are collected, in days. Set this parameter to a value in the `YYYYMMdd` format.

This parameter is required.', example='20241205'),
  orderColumn?: string(name='orderColumn', description='The sorting column.', example='totalFrequency'),
  pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
  pageSize?: long(name='pageSize', description='The number of entries per page. Default value: 10.', example='10'),
  recentDays?: int32(name='recentDays', description='The number of recent days for comparison.', example='1'),
  region?: string(name='region', description='The region ID.', example='cn-beijing'),
  schema?: string(name='schema', description='The name of the schema.', example='schema'),
  tablePrefix?: string(name='tablePrefix', description='The name of the table that you want to use for fuzzy match.', example='bank'),
  tenantId?: string(name='tenantId', description='The ID of the tenant. You can log on to the MaxCompute console, and choose **Tenants** > **Tenant Property** from the left-side navigation pane to view the tenant ID.', example='28074710977****'),
  typesShrink?: string(name='types', description='The storage types.'),
}

model ListStorageTablesInfoResponseBody = {
  data?: {
    date?: string(name='date', description='The date on which the statistics are collected.', example='20241205'),
    pageNumber?: long(name='pageNumber', description='The page number.', example='1'),
    pageSize?: long(name='pageSize', description='The number of entries per page.', example='10'),
    storageTableInfoList?: [ 
      {
        date?: string(name='date', description='The date on which the statistics are collected. This value is not returned.', example='20241205'),
        isPartitioned?: boolean(name='isPartitioned', description='Indicates whether the table is a partitioned table.', example='false'),
        lastAccessTime?: long(name='lastAccessTime', description='The time when the table was last accessed. This value is returned when the table is a non-partitioned table.

>  The data collection method is upgraded from July 2023. If the data is not accessed after the upgrade or is accessed by using ALGO jobs or the direct read method of Hologres, the last access time cannot be collected.', example='1694589365'),
        longTermStorage?: double(name='longTermStorage', description='The storage usage at the long-term storage tier.', example='0'),
        longTermStorageFileCount?: long(name='longTermStorageFileCount', description='The number of long-term storage files.', example='0'),
        longTermStorageUnit?: string(name='longTermStorageUnit', description='The unit of the storage usage at the long-term storage tier.', example='B'),
        lowFreqStorage?: double(name='lowFreqStorage', description='The storage usage at the low-frequency tier.', example='0'),
        lowFreqStorageFileCount?: long(name='lowFreqStorageFileCount', description='The number of low-frequency storage files.', example='0'),
        lowFreqStorageUnit?: string(name='lowFreqStorageUnit', description='The unit of the storage usage at the low-frequency storage tier.', example='B'),
        projectName?: string(name='projectName', description='The project name.', example='odps_project'),
        rate?: double(name='rate', description='The change rate of the total storage usage compared with that of the recent {$recentDays} days.', example='0'),
        schemaName?: string(name='schemaName', description='The schema name.', example='schema'),
        standardStorage?: double(name='standardStorage', description='The storage usage at the standard storage tier.', example='600'),
        standardStorageFileCount?: long(name='standardStorageFileCount', description='The number of standard storage files.', example='2'),
        standardStorageUnit?: string(name='standardStorageUnit', description='The unit of the storage usage at the standard storage tier.', example='KB'),
        storageType?: string(name='storageType', description='The table storage type.

*   standard
*   lowfrequency
*   longterm
*   unknown: This value is returned when the table is a partitioned table. You can call the ListStoragePartitionsInfo operation to query the storage type of each partition.', example='standard'),
        tableName?: string(name='tableName', description='The table name.', example='bank_data'),
        totalFrequency?: long(name='totalFrequency', description='The access frequency.

> 

*   Access behaviors include:

*   The table is used as the input table of an SQL task.
*   The table is downloaded by Tunnel.
*   The table is read by calling the Storage API. The partition granularity of the partitioned table is not available. Each time an access operation is performed, the access frequency is incremented by 1.

*   The data collection method is upgraded from July 2023. If the data is not accessed after the upgrade or is accessed by using ALGO jobs or the direct read method of Hologres, the access frequency cannot be collected.', example='10'),
        totalInputAmount?: double(name='totalInputAmount', description='The total amount of accessed data.

>  The amount of data that is read by all access behaviors.', example='1'),
        totalInputAmountUnit?: string(name='totalInputAmountUnit', description='The unit of the total amount of accessed data.', example='GB'),
        totalStorage?: double(name='totalStorage', description='The total storage usage. For a partitioned table, this parameter indicates the sum of the storage usage of all partitions. If the storage types of partitions are different, the value is the sum of the storage usage of each storage type.', example='600'),
        totalStorageFileCount?: long(name='totalStorageFileCount', description='The total number of files.', example='2'),
        totalStorageUnit?: string(name='totalStorageUnit', description='The unit of storage usage.', example='KB'),
      }
    ](name='storageTableInfoList', description='The table storage information.'),
    totalCount?: long(name='totalCount', description='The total number of entries returned.', example='1'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters and syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0bc12e6a16679892465424670db3eb'),
}

model ListStorageTablesInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListStorageTablesInfoResponseBody(name='body'),
}

/**
 * @summary Queries the table storage details of a MaxCompute project.
 *
 * @param tmpReq ListStorageTablesInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListStorageTablesInfoResponse
 */
async function listStorageTablesInfoWithOptions(project: string, tmpReq: ListStorageTablesInfoRequest, headers: map[string]string, runtime: $RuntimeOptions): ListStorageTablesInfoResponse {
  tmpReq.validate();
  var request = new ListStorageTablesInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.types)) {
    request.typesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.types, 'types', 'simple');
  }
  var query : map[string]any = {};
  if (!$isNull(request.ascOrder)) {
    query['ascOrder'] = request.ascOrder;
  }
  if (!$isNull(request.date)) {
    query['date'] = request.date;
  }
  if (!$isNull(request.orderColumn)) {
    query['orderColumn'] = request.orderColumn;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.recentDays)) {
    query['recentDays'] = request.recentDays;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.schema)) {
    query['schema'] = request.schema;
  }
  if (!$isNull(request.tablePrefix)) {
    query['tablePrefix'] = request.tablePrefix;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }
  if (!$isNull(request.typesShrink)) {
    query['types'] = request.typesShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListStorageTablesInfo',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/observations/analysis/storage/projects/${$URL.percentEncode(project)}/tablesInfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the table storage details of a MaxCompute project.
 *
 * @param request ListStorageTablesInfoRequest
 * @return ListStorageTablesInfoResponse
 */
async function listStorageTablesInfo(project: string, request: ListStorageTablesInfoRequest): ListStorageTablesInfoResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listStorageTablesInfoWithOptions(project, request, headers, runtime);
}

model ListTablesRequest {
  marker?: string(name='marker', description='Specifies the marker after which the returned list begins.', example='Y29tbWlzc2lvbl9leHRlcm5hbF91cmdlXzFfd3Ih'),
  maxItem?: int32(name='maxItem', description='The maximum number of entries to return on each page.', example='10'),
  prefix?: string(name='prefix', description='The names of the returned resources. The names must start with the value specified by the prefix parameter. If the prefix parameter is set to a, the names of the returned resources must start with a.', example='a'),
  schemaName?: string(name='schemaName', description='The name of the schema.', example='default'),
  type?: string(name='type', description='The type of the table.', example='internal'),
}

model ListTablesResponseBody = {
  data?: {
    marker?: string(name='marker', description='Indicates the marker after which the returned list begins.', example='cHlvZHBzX3VkZl8xMDExNV8xNDU3NDI4NDkzKg=='),
    maxItem?: int32(name='maxItem', description='The maximum number of entries returned per page.', example='10'),
    tables?: [ 
      {
        creationTime?: long(name='creationTime', description='The time when the table was created.', example='2022-01-17T07:07:47Z'),
        displayName?: string(name='displayName', description='The display name of the table.', example='sale_detail'),
        name?: string(name='name', description='The name of the table.', example='dim_odps'),
        owner?: string(name='owner', description='The owner of the table.', example='1887853961230110'),
        schema?: string(name='schema', description='The schema to which the table belongs.', example='default'),
        type?: string(name='type', description='The type of the table.', example='internal'),
      }
    ](name='tables', description='The information about tables.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The request ID.', example='0a06dd4516687375802853481ec9fd'),
}

model ListTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTablesResponseBody(name='body'),
}

/**
 * @summary Obtains tables in a MaxCompute project.
 *
 * @param request ListTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTablesResponse
 */
async function listTablesWithOptions(projectName: string, request: ListTablesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListTablesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.marker)) {
    query['marker'] = request.marker;
  }
  if (!$isNull(request.maxItem)) {
    query['maxItem'] = request.maxItem;
  }
  if (!$isNull(request.prefix)) {
    query['prefix'] = request.prefix;
  }
  if (!$isNull(request.schemaName)) {
    query['schemaName'] = request.schemaName;
  }
  if (!$isNull(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTables',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/tables`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains tables in a MaxCompute project.
 *
 * @param request ListTablesRequest
 * @return ListTablesResponse
 */
async function listTables(projectName: string, request: ListTablesRequest): ListTablesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listTablesWithOptions(projectName, request, headers, runtime);
}

model ListTunnelQuotaTimerResponseBody = {
  data?: [ 
    {
      beginTime?: string(name='beginTime', description='The start time of the time-specific configuration.', example='00:00'),
      endTime?: string(name='endTime', description='The end time of the time-specific configuration.', example='08:00'),
      timezone?: string(name='timezone', description='The time zone property for the time-specific configuration.', example='Asia/Shanghai'),
      tunnelQuotaParameter?: {
        elasticReservedSlotNum?: long(name='elasticReservedSlotNum', description='The number of elastically reserved slots.', example='100'),
        slotNum?: long(name='slotNum', description='The number of reserved slots.', example='100'),
      }(name='tunnelQuotaParameter', description='The parameters for the time-specific configuration.'),
    }
  ](name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0be3e0b716671885050924814e3623'),
}

model ListTunnelQuotaTimerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTunnelQuotaTimerResponseBody(name='body'),
}

/**
 * @summary Displays the time-specific configuration of an exclusive resource group for Tunnel (referred to as Tunnel quota).
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTunnelQuotaTimerResponse
 */
async function listTunnelQuotaTimerWithOptions(nickname: string, headers: map[string]string, runtime: $RuntimeOptions): ListTunnelQuotaTimerResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTunnelQuotaTimer',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/tunnel/${$URL.percentEncode(nickname)}/timers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Displays the time-specific configuration of an exclusive resource group for Tunnel (referred to as Tunnel quota).
 *
 * @return ListTunnelQuotaTimerResponse
 */
async function listTunnelQuotaTimer(nickname: string): ListTunnelQuotaTimerResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listTunnelQuotaTimerWithOptions(nickname, headers, runtime);
}

model ListUsersRequest {
  pageNumber?: int32(name='pageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='pageSize', description='The number of entries to return on each page.', example='10'),
}

model ListUsersResponseBody = {
  data?: {
    pageNumber?: int32(name='pageNumber', description='The page number of the returned page.', example='2'),
    pageSize?: int32(name='pageSize', description='The number of entries returned per page.', example='10'),
    totalCount?: int32(name='totalCount', description='The total number of returned entries.', example='64'),
    users?: [ 
      {
        accountId?: string(name='accountId', description='The ID of the Alibaba Cloud account.', example='167835629082'),
        accountName?: string(name='accountName', description='The username of the account.', example='Bob@'),
        accountType?: string(name='accountType', description='The type of the account.', example='ALIYUN'),
        displayName?: string(name='displayName', description='The display name.', example='Bob'),
        tenantId?: string(name='tenantId', description='The ID of the tenant.', example='1567253789'),
      }
    ](name='users', description='The users.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0a06dd4816687424611405643e3730'),
}

model ListUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUsersResponseBody(name='body'),
}

/**
 * @summary Queries a list of all users under a tenant.
 *
 * @param request ListUsersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUsersResponse
 */
async function listUsersWithOptions(request: ListUsersRequest, headers: map[string]string, runtime: $RuntimeOptions): ListUsersResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUsers',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/users`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of all users under a tenant.
 *
 * @param request ListUsersRequest
 * @return ListUsersResponse
 */
async function listUsers(request: ListUsersRequest): ListUsersResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listUsersWithOptions(request, headers, runtime);
}

model ListUsersByRoleResponseBody = {
  data?: {
    users?: [ 
      {
        name?: string(name='name', description='The name of the user.', example='ALIYUN${account_name}'),
      }
    ](name='users', description='The users.'),
  }(name='data', description='The returned data.'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0be3e0bb16654558425251398e27a9'),
}

model ListUsersByRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUsersByRoleResponseBody(name='body'),
}

/**
 * @summary Obtains information about the users who are assigned a project-level role.
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUsersByRoleResponse
 */
async function listUsersByRoleWithOptions(projectName: string, roleName: string, headers: map[string]string, runtime: $RuntimeOptions): ListUsersByRoleResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUsersByRole',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/roles/${$URL.percentEncode(roleName)}/users`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains information about the users who are assigned a project-level role.
 *
 * @return ListUsersByRoleResponse
 */
async function listUsersByRole(projectName: string, roleName: string): ListUsersByRoleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listUsersByRoleWithOptions(projectName, roleName, headers, runtime);
}

model QueryQuotaRequest {
  akProven?: string(name='AkProven', description='The trusted AccessKey pairs.', example='null'),
  mock?: boolean(name='mock', description='Specifies whether to include submodules. Valid values: true and false. -true: The request includes submodules. -false (default): The request does not include submodules.', example='false'),
  region?: string(name='region', description='The region ID.', example='cn-chengdu'),
  tenantId?: string(name='tenantId', description='The tenant ID.', example='483212237127906'),
}

model QueryQuotaResponseBody = {
  data?: {
    billingPolicy?: {
      billingMethod?: string(name='billingMethod', description='The billing method. Valid values:

*   subscription: the subscription quota.
*   payasyougo: the pay-as-you-go quota.', example='subscription'),
      instanceId?: string(name='instanceId', description='In MaxCompute, instanceId and orderId are considered the same.', example='880c0d0d-5d79-4217-b683-8e8bdd2a2523'),
      odpsSpecCode?: string(name='odpsSpecCode', description='The order specifications.', example='OdpsStandard'),
      orderId?: string(name='orderId', description='The order ID.', example='880c0d0d-5d79-4217-b683-8e8bdd2a2523'),
    }(name='billingPolicy', description='The order information.'),
    cluster?: string(name='cluster', description='The ID of the Managed Service for Prometheus cluster.', example='AT-120N'),
    createTime?: long(name='createTime', description='The time when the resource was created.', example='1714356241163'),
    creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the quota plan.', example='1248953767546358'),
    groupName?: string(name='groupName', description='The group name.', example='abc'),
    id?: string(name='id', description='The quota ID.', example='2523'),
    name?: string(name='name', description='The quota name.', example='quota_a'),
    nickName?: string(name='nickName', description='The quota alias.', example='quota_nickname'),
    parameter?: map[string]any(name='parameter', description='The quota description.', example='{"minCU":10,	
"adhocCU":0,
"maxCU":10,
"schedulerType":"Fair",
}'),
    parentId?: string(name='parentId', description='The parent resource ID.', example='null'),
    regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
    saleTag?: {
      resourceIds?: [ string ](name='resourceIds', description='The identifier of a MaxCompute quota object. This identifier exists in the Alibaba Cloud sales bill. You can use this identifier to associate the cost of a quota object with a tag.'),
      resourceType?: string(name='resourceType', description='The object type. Valid values: quota and project.', example='project'),
    }(name='saleTag', description='The identifiers of MaxCompute quota objects. The identifiers are the same as those in the Alibaba Cloud sales bill. This parameter is used for tags.'),
    scheduleInfo?: {
      currPlan?: string(name='currPlan', description='The current quota plan that has taken effect based on the scheduling plan.', example='planA'),
      currTime?: string(name='currTime', description='The time when the plan specified by currPlan is scheduled.', example='0800'),
      nextPlan?: string(name='nextPlan', description='The quota plan that will take effect based on the scheduling plan.', example='planB'),
      nextTime?: string(name='nextTime', description='The time when the plan specified by nextPlan is scheduled.', example='1700'),
      oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan specified by this parameter is triggered and the plan is different from the plan specified by currPlan, this parameter is not empty.', example='planC'),
      onceTime?: string(name='onceTime', description='The time when the quota plan specified by oncePlan is scheduled.', example='1500'),
      operatorName?: string(name='operatorName', description='The operator name.', example='userA'),
      timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
    }(name='scheduleInfo', description='The information about the scheduling plan.'),
    status?: string(name='status', description='The status of the resource.', example='ON'),
    subQuotaInfoList?: [ 
      {
        billingPolicy?: {
          billingMethod?: string(name='billingMethod', description='The billing method. Valid values:

*   subscription: the subscription quota.
*   payasyougo: the pay-as-you-go quota.', example='subscription'),
          instanceId?: string(name='instanceId', description='In MaxCompute, instanceId and orderId are considered the same.', example='880c0d0d-5d79-4217-b683-8e8bdd2a2523'),
          odpsSpecCode?: string(name='odpsSpecCode', description='The order specifications.', example='OdpsStandard'),
          orderId?: string(name='orderId', description='The order ID.', example='880c0d0d-5d79-4217-b683-8e8bdd2a2523'),
        }(name='billingPolicy', description='The order information.'),
        cluster?: string(name='cluster', description='The cluster ID.', example='AT-120N'),
        createTime?: long(name='createTime', description='The time when the resource was created.', example='1688653978768'),
        creatorId?: string(name='creatorId', description='The ID of the Alibaba Cloud account that is used to create the quota plan.', example='672863518'),
        groupName?: string(name='groupName', description='The role group name.', example='abc'),
        id?: string(name='id', description='The ID of the level-2 quota.', example='1000048'),
        name?: string(name='name', description='The name of the level-2 quota.', example='subquotaA'),
        nickName?: string(name='nickName', description='The nickname of the level-2 quota.', example='subquotaA'),
        parameter?: map[string]any(name='parameter', description='The quota description.', example='{\\\\"maxCU\\\\": 10, \\\\"minCU\\\\": 10, \\\\"adhocCU\\\\": 0, \\\\"schedulerType\\\\": \\\\"Fifo\\\\"}'),
        parentId?: string(name='parentId', description='The parent resource ID.', example='0'),
        regionId?: string(name='regionId', description='The region ID.', example='cn-beijing'),
        saleTag?: {
          resourceIds?: [ string ](name='resourceIds', description='The identifier of a MaxCompute quota object. This identifier exists in the Alibaba Cloud sales bill. You can use this identifier to associate the cost of a quota object with a tag.'),
          resourceType?: string(name='resourceType', description='The object type. Valid values: quota and project.', example='"quota"'),
        }(name='saleTag', description='The identifiers of MaxCompute quota objects. The identifiers are the same as those in the Alibaba Cloud sales bill. This parameter is used for tags.'),
        scheduleInfo?: {
          currPlan?: string(name='currPlan', description='The current quota plan that has taken effect based on the scheduling plan.', example='planA'),
          currTime?: string(name='currTime', description='The time when the plan specified by currPlan is scheduled.', example='0800'),
          nextPlan?: string(name='nextPlan', description='The quota plan that will take effect based on the scheduling plan.', example='planB'),
          nextTime?: string(name='nextTime', description='The time when the plan specified by nextPlan is scheduled.', example='1700'),
          oncePlan?: string(name='oncePlan', description='The quota plan that immediately takes effect. If the quota plan specified by this parameter is triggered and the plan is different from the plan specified by currPlan, this parameter is not empty.', example='planC'),
          onceTime?: string(name='onceTime', description='The time when the quota plan specified by oncePlan is scheduled.', example='1500'),
          operatorName?: string(name='operatorName', description='The operator name.', example='userA'),
          timezone?: string(name='timezone', description='The time zone of the project.', example='UTC+8'),
        }(name='scheduleInfo', description='The information about the scheduling plan.'),
        status?: string(name='status', description='The status of the resource.', example='ON'),
        tag?: string(name='tag', description='The resource tag of a quota.', example='abc'),
        tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
        type?: string(name='type', description='This parameter corresponds to the resourceSystemType field.', example='FUXI_ONLINE'),
        version?: string(name='version', description='The version number.', example='1'),
      }
    ](name='subQuotaInfoList', description='The level-2 quotas.'),
    tag?: string(name='tag', description='The resource tag of a quota.', example='abc'),
    tenantId?: string(name='tenantId', description='The tenant ID.', example='478403690625249'),
    type?: string(name='type', description='This parameter corresponds to the resourceSystemType field.', example='FUXI_OFFLINE'),
    version?: string(name='version', description='The version number.', example='1'),
  }(name='data', description='The data returned.'),
  errorCode?: string(name='errorCode', description='The error code.', example='success'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='Exception information'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0bc1eeed16675342848904412e08dd'),
}

model QueryQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryQuotaResponseBody(name='body'),
}

/**
 * @summary Queries the information about a specified level-1 quota group.
 *
 * @param request QueryQuotaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryQuotaResponse
 */
async function queryQuotaWithOptions(nickname: string, request: QueryQuotaRequest, headers: map[string]string, runtime: $RuntimeOptions): QueryQuotaResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.akProven)) {
    query['AkProven'] = request.akProven;
  }
  if (!$isNull(request.mock)) {
    query['mock'] = request.mock;
  }
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'QueryQuota',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/query`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a specified level-1 quota group.
 *
 * @param request QueryQuotaRequest
 * @return QueryQuotaResponse
 */
async function queryQuota(nickname: string, request: QueryQuotaRequest): QueryQuotaResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return queryQuotaWithOptions(nickname, request, headers, runtime);
}

model QueryTunnelMetricRequest {
  codeList?: [ int32 ](name='codeList'),
  groupList?: [ string ](name='groupList'),
  operationList?: [ string ](name='operationList'),
  project?: string(name='project', example='project_a'),
  quotaNickname?: string(name='quotaNickname', example='default'),
  tableList?: [ string ](name='tableList'),
  topN?: int32(name='topN', example='10'),
  endTime?: long(name='endTime', description='This parameter is required.', example='1735536322'),
  startTime?: long(name='startTime', description='This parameter is required.', example='1735534322'),
  strategy?: string(name='strategy', example='max'),
}

model QueryTunnelMetricResponseBody = {
  data?: {
    category?: string(name='category', example='tunnel'),
    metrics?: [ 
      {
        metric?: map[string]string(name='metric'),
        values?: [[ double ]        ](name='values'),
      }
    ](name='metrics'),
    name?: string(name='name', example='slot_usage'),
    period?: long(name='period', example='60'),
  }(name='data'),
  errorCode?: string(name='errorCode', example='success'),
  errorMsg?: string(name='errorMsg', example='0A3B1E82006A23A918C70905BF08AEC7'),
  httpCode?: int32(name='httpCode', example='200'),
  requestId?: string(name='requestId', example='0bc3b4b016674434996033675e71ee'),
}

model QueryTunnelMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTunnelMetricResponseBody(name='body'),
}

/**
 * @summary 查询tunnel资源使用信息
 *
 * @param request QueryTunnelMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTunnelMetricResponse
 */
async function queryTunnelMetricWithOptions(metric: string, request: QueryTunnelMetricRequest, headers: map[string]string, runtime: $RuntimeOptions): QueryTunnelMetricResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.endTime)) {
    query['endTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['startTime'] = request.startTime;
  }
  if (!$isNull(request.strategy)) {
    query['strategy'] = request.strategy;
  }

  var body : map[string]any = {};
  if (!$isNull(request.codeList)) {
    body['codeList'] = request.codeList;
  }
  if (!$isNull(request.groupList)) {
    body['groupList'] = request.groupList;
  }
  if (!$isNull(request.operationList)) {
    body['operationList'] = request.operationList;
  }
  if (!$isNull(request.project)) {
    body['project'] = request.project;
  }
  if (!$isNull(request.quotaNickname)) {
    body['quotaNickname'] = request.quotaNickname;
  }
  if (!$isNull(request.tableList)) {
    body['tableList'] = request.tableList;
  }
  if (!$isNull(request.topN)) {
    body['topN'] = request.topN;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'QueryTunnelMetric',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/observations/tunnel/${$URL.percentEncode(metric)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询tunnel资源使用信息
 *
 * @param request QueryTunnelMetricRequest
 * @return QueryTunnelMetricResponse
 */
async function queryTunnelMetric(metric: string, request: QueryTunnelMetricRequest): QueryTunnelMetricResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return queryTunnelMetricWithOptions(metric, request, headers, runtime);
}

model QueryTunnelMetricDetailRequest {
  ascOrder?: boolean(name='ascOrder', example='false'),
  groupList?: [ string ](name='groupList'),
  limit?: long(name='limit', example='10'),
  operationList?: [ string ](name='operationList'),
  orderColumn?: string(name='orderColumn', example='maxValue'),
  project?: string(name='project', example='project_a'),
  quotaNickname?: string(name='quotaNickname', example='quota_A'),
  tableList?: [ string ](name='tableList'),
  endTime?: long(name='endTime', description='This parameter is required.', example='1735536322'),
  startTime?: long(name='startTime', description='This parameter is required.', example='1735534322'),
}

model QueryTunnelMetricDetailResponseBody = {
  data?: {
    metrics?: [ 
      {
        metric?: map[string]string(name='metric'),
        value?: map[string]any(name='value', example='"avgValue":"11.5"'),
      }
    ](name='metrics'),
    name?: string(name='name', example='tableA'),
  }(name='data'),
  errorCode?: string(name='errorCode', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', example='plan \\\\"***\\\\" does not exist'),
  httpCode?: int32(name='httpCode', example='200'),
  requestId?: string(name='requestId', example='0a06dd4516687375802853481ec9fd'),
}

model QueryTunnelMetricDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTunnelMetricDetailResponseBody(name='body'),
}

/**
 * @summary 查询tunnel资源使用详情
 *
 * @param request QueryTunnelMetricDetailRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTunnelMetricDetailResponse
 */
async function queryTunnelMetricDetailWithOptions(metric: string, request: QueryTunnelMetricDetailRequest, headers: map[string]string, runtime: $RuntimeOptions): QueryTunnelMetricDetailResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.endTime)) {
    query['endTime'] = request.endTime;
  }
  if (!$isNull(request.startTime)) {
    query['startTime'] = request.startTime;
  }

  var body : map[string]any = {};
  if (!$isNull(request.ascOrder)) {
    body['ascOrder'] = request.ascOrder;
  }
  if (!$isNull(request.groupList)) {
    body['groupList'] = request.groupList;
  }
  if (!$isNull(request.limit)) {
    body['limit'] = request.limit;
  }
  if (!$isNull(request.operationList)) {
    body['operationList'] = request.operationList;
  }
  if (!$isNull(request.orderColumn)) {
    body['orderColumn'] = request.orderColumn;
  }
  if (!$isNull(request.project)) {
    body['project'] = request.project;
  }
  if (!$isNull(request.quotaNickname)) {
    body['quotaNickname'] = request.quotaNickname;
  }
  if (!$isNull(request.tableList)) {
    body['tableList'] = request.tableList;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'QueryTunnelMetricDetail',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/observations/tunnel/${$URL.percentEncode(metric)}/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询tunnel资源使用详情
 *
 * @param request QueryTunnelMetricDetailRequest
 * @return QueryTunnelMetricDetailResponse
 */
async function queryTunnelMetricDetail(metric: string, request: QueryTunnelMetricDetailRequest): QueryTunnelMetricDetailResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return queryTunnelMetricDetailWithOptions(metric, request, headers, runtime);
}

model RetryMmsJobResponseBody = {
  data?: long(name='data', example='78'),
  requestId?: string(name='requestId', example='7F5DAD1C-9EC2-5FE5-97CF-BCE21B4ABA29'),
}

model RetryMmsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetryMmsJobResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetryMmsJobResponse
 */
async function retryMmsJobWithOptions(sourceId: string, jobId: string, headers: map[string]string, runtime: $RuntimeOptions): RetryMmsJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'RetryMmsJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs/${$URL.percentEncode(jobId)}/retry`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return RetryMmsJobResponse
 */
async function retryMmsJob(sourceId: string, jobId: string): RetryMmsJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return retryMmsJobWithOptions(sourceId, jobId, headers, runtime);
}

model StartMmsJobResponseBody = {
  data?: long(name='data', example='88'),
  requestId?: string(name='requestId', example='5CA6292A-E301-5CD8-B4E2-AF060F99147B'),
}

model StartMmsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartMmsJobResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartMmsJobResponse
 */
async function startMmsJobWithOptions(sourceId: string, jobId: string, headers: map[string]string, runtime: $RuntimeOptions): StartMmsJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'StartMmsJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs/${$URL.percentEncode(jobId)}/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return StartMmsJobResponse
 */
async function startMmsJob(sourceId: string, jobId: string): StartMmsJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return startMmsJobWithOptions(sourceId, jobId, headers, runtime);
}

model StopMmsJobResponseBody = {
  data?: long(name='data', example='88'),
  requestId?: string(name='requestId', example='8023D058-62B7-5C49-8EB6-AD9BA7942BC5'),
}

model StopMmsJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopMmsJobResponseBody(name='body'),
}

/**
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopMmsJobResponse
 */
async function stopMmsJobWithOptions(sourceId: string, jobId: string, headers: map[string]string, runtime: $RuntimeOptions): StopMmsJobResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'StopMmsJob',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}/jobs/${$URL.percentEncode(jobId)}/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return StopMmsJobResponse
 */
async function stopMmsJob(sourceId: string, jobId: string): StopMmsJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return stopMmsJobWithOptions(sourceId, jobId, headers, runtime);
}

model UpdateComputeQuotaPlanRequest {
  name?: string(name='name', description='The name of quota plan.

This parameter is required.', example='planA'),
  quota?: {
    parameter?: {
      elasticReservedCU?: long(name='elasticReservedCU', description='The value of elastic Reserved CUs in the level-1 quota.
> The default value is 0. The maximum value of this parameter must be equal to the number of subscription-based reserved CUs and cannot exceed 10,000 CUs.

This parameter is required.', example='50'),
    }(name='parameter', description='The parameters of level-1 quota.'),
    subQuotaInfoList?: [ 
      {
        nickName?: string(name='nickName', description='The nickname of the level-2 quota.

This parameter is required.', example='os_ComputeQuota'),
        parameter?: {
          elasticReservedCU?: long(name='elasticReservedCU', description='The value of elastic Reserved CUs.
> The total number of elastically reserved CUs in all the level-2 quotas is equal to the number of elastically reserved CUs in the level-1 quota.

This parameter is required.', example='50'),
          maxCU?: long(name='maxCU', description='The value of maxCU in Reserved CUs.
> The value of maxCU must be less than or equal to the value of maxCU in the level-1 quota that you purchased.

This parameter is required.', example='50'),
          minCU?: long(name='minCU', description='The value of minCU in Reserved CUs.
> 
>- The total value of minCU in all the level-2 quotas is equal to the value of minCU in the level-1 quota.
>- The value of minCU must be less than or equal to the value of maxCU in the level-2 quota and less than or equal to the value of minCU in the level-1 quota that you purchased.

This parameter is required.', example='50'),
        }(name='parameter', description='The parameters of the level-2 quota.'),
      }
    ](name='subQuotaInfoList', description='The list of level-2 quotas.'),
  }(name='quota', description='The parameters of quota plan.'),
}

model UpdateComputeQuotaPlanResponseBody = {
  data?: string(name='data', description='The data returned.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='QUOTA_PLAN_NOT_FOUND'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='plan \\\\"***\\\\" does not exist'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0be3e0aa16667684362147582e038f'),
}

model UpdateComputeQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateComputeQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Update the ComputeQuotaPlan.
 *
 * @description Please ensure that before using this interface, you have fully understood the <props="china">[Pricing and Charges](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Charges](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param request UpdateComputeQuotaPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateComputeQuotaPlanResponse
 */
async function updateComputeQuotaPlanWithOptions(nickname: string, request: UpdateComputeQuotaPlanRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateComputeQuotaPlanResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.quota)) {
    body['quota'] = request.quota;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateComputeQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaPlan`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the ComputeQuotaPlan.
 *
 * @description Please ensure that before using this interface, you have fully understood the <props="china">[Pricing and Charges](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Charges](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param request UpdateComputeQuotaPlanRequest
 * @return UpdateComputeQuotaPlanResponse
 */
async function updateComputeQuotaPlan(nickname: string, request: UpdateComputeQuotaPlanRequest): UpdateComputeQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateComputeQuotaPlanWithOptions(nickname, request, headers, runtime);
}

model UpdateComputeQuotaScheduleRequest {
  body?: [ 
    {
      condition?: {
        at?: string(name='at', description='The start time when the quota plan takes effect.

This parameter is required.', example='10:00'),
      }(name='condition', description='The value of effective condition.'),
      plan?: string(name='plan', description='The name of the quota plan.

This parameter is required.', example='planA'),
      type?: string(name='type', description='The type of the quota plan.

>Notice: Currently, only daily is supported.</notice>

This parameter is required.', example='daily'),
    }
  ](name='body', description='The request body parameters.'),
  scheduleTimezone?: string(name='scheduleTimezone'),
}

model UpdateComputeQuotaScheduleResponseBody = {
  data?: string(name='data', description='The data returned.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='QUOTA_PLAN_NOT_FOUND'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='plan \\\\"***\\\\" does not exist'),
  httpCode?: int32(name='httpCode', description='HTTP status code.
- 1xx: Informational - The request has been received and is being processed.
- 2xx: Success - The request action was successfully received, understood, and accepted by the server.
- 3xx: Redirection - Further action must be taken to complete the request.
- 4xx: Client Error - The request contains an error in the request parameters, syntax, or specific request conditions cannot be met.
- 5xx: Server Error - The server could not fulfill the request due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0be3e0aa16667684362147582e038f'),
}

model UpdateComputeQuotaScheduleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateComputeQuotaScheduleResponseBody(name='body'),
}

/**
 * @summary Update the time-based plan for computing quota.
 *
 * @description Please ensure that before using this interface, you have fully understood the<props="china">[Pricing and Billing](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Billing](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param request UpdateComputeQuotaScheduleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateComputeQuotaScheduleResponse
 */
async function updateComputeQuotaScheduleWithOptions(nickname: string, request: UpdateComputeQuotaScheduleRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateComputeQuotaScheduleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.scheduleTimezone)) {
    query['scheduleTimezone'] = request.scheduleTimezone;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.toArray(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateComputeQuotaSchedule',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeQuotaSchedule`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the time-based plan for computing quota.
 *
 * @description Please ensure that before using this interface, you have fully understood the<props="china">[Pricing and Billing](https://help.aliyun.com/zh/maxcompute/product-overview/computing-pricing-1)
 * <props="intl">[Pricing and Billing](https://www.alibabacloud.com/help/maxcompute/product-overview/computing-pricing-1) of MaxCompute Elastic Reserved CU.
 *
 * @param request UpdateComputeQuotaScheduleRequest
 * @return UpdateComputeQuotaScheduleResponse
 */
async function updateComputeQuotaSchedule(nickname: string, request: UpdateComputeQuotaScheduleRequest): UpdateComputeQuotaScheduleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateComputeQuotaScheduleWithOptions(nickname, request, headers, runtime);
}

model UpdateComputeSubQuotaRequest {
  subQuotaInfoList?: [ 
    {
      nickName?: string(name='nickName', description='The nickname of the level-2 quota.

This parameter is required.', example='os_ComputeQuota'),
      parameter?: {
        enablePriority?: boolean(name='enablePriority', description='Specifies whether to enable the priority feature.', example='false'),
        forceReservedMin?: boolean(name='forceReservedMin', description='Specifies whether the quota is strongly exclusive.', example='false'),
        maxCU?: long(name='maxCU', description='The value of minCU in Reserved CUs.
> The value of maxCU must be less than or equal to the value of maxCU in the level-1 quota that you purchased.

This parameter is required.', example='50'),
        minCU?: long(name='minCU', description='The value of maxCU in Reserved CUs.
> 
>- The total value of minCU in all the level-2 quotas is equal to the value of minCU in the level-1 quota.
>- The value of minCU must be less than or equal to the value of maxCU in the level-2 quota and less than or equal to the value of minCU in the level-1 quota that you purchased.

This parameter is required.', example='50'),
        schedulerType?: string(name='schedulerType', description='Scheduling policy of the quota.', example='Fifo/Fair'),
        singleJobCULimit?: long(name='singleJobCULimit', description='The upper limit for CUs that can be concurrently used by a job scheduled to the quota.', example='10'),
      }(name='parameter', description='The parameters of the level-2 quota.'),
      type?: string(name='type', description='The type of quota.

> 
> - FUXI_OFFLINE(default) : Quotas of this type are used to run batch jobs.', example='FUXI_OFFLINE'),
    }
  ](name='subQuotaInfoList', description='The list of level-2 quotas.'),
}

model UpdateComputeSubQuotaResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='this quota is not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.
- 4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
- 5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0b57ff7616612271051086500ea3ce'),
}

model UpdateComputeSubQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateComputeSubQuotaResponseBody(name='body'),
}

/**
 * @summary Update the basic configuration of the calculation quota, including adding or deleting the sub quota, modifying the basic properties of the secondary quota, and the CU configuration of the effective quota plan.
 *
 * @param request UpdateComputeSubQuotaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateComputeSubQuotaResponse
 */
async function updateComputeSubQuotaWithOptions(nickname: string, request: UpdateComputeSubQuotaRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateComputeSubQuotaResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.subQuotaInfoList)) {
    body['subQuotaInfoList'] = request.subQuotaInfoList;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateComputeSubQuota',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/computeSubQuota`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update the basic configuration of the calculation quota, including adding or deleting the sub quota, modifying the basic properties of the secondary quota, and the CU configuration of the effective quota plan.
 *
 * @param request UpdateComputeSubQuotaRequest
 * @return UpdateComputeSubQuotaResponse
 */
async function updateComputeSubQuota(nickname: string, request: UpdateComputeSubQuotaRequest): UpdateComputeSubQuotaResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateComputeSubQuotaWithOptions(nickname, request, headers, runtime);
}

model UpdateMmsDataSourceRequest {
  action?: string(name='action'),
  config?: map[string]any(name='config'),
  name?: string(name='name'),
  test?: boolean(name='test'),
}

model UpdateMmsDataSourceResponseBody = {
  data?: {
    asyncTaskId?: long(name='asyncTaskId'),
    sourceId?: long(name='sourceId'),
  }(name='data'),
  requestId?: string(name='requestId', example='76CE80C8-7392-5591-BCC8-610AFBF78ADF'),
}

model UpdateMmsDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateMmsDataSourceResponseBody(name='body'),
}

/**
 * @summary 更新数据源配置、名称，启/停数据源实例
 *
 * @param request UpdateMmsDataSourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateMmsDataSourceResponse
 */
async function updateMmsDataSourceWithOptions(sourceId: string, request: UpdateMmsDataSourceRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateMmsDataSourceResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.action)) {
    body['action'] = request.action;
  }
  if (!$isNull(request.config)) {
    body['config'] = request.config;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.test)) {
    body['test'] = request.test;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateMmsDataSource',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/mms/datasources/${$URL.percentEncode(sourceId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新数据源配置、名称，启/停数据源实例
 *
 * @param request UpdateMmsDataSourceRequest
 * @return UpdateMmsDataSourceResponse
 */
async function updateMmsDataSource(sourceId: string, request: UpdateMmsDataSourceRequest): UpdateMmsDataSourceResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateMmsDataSourceWithOptions(sourceId, request, headers, runtime);
}

model UpdatePackageRequest {
  body?: string(name='body', description='The request body parameters.', example='{
    "add": {
        "allowedProjectList": [
            {
                "label": "2",
                "project": "project_name"
            }
        ],
        "resourceList": {
            "table": [
                {
                    "name": "table_name",
                    "actions": [
                        "Describe",
                        "Select"
                    ]
                },
                {
                    "name": "table_name",
                    "actions": [
                        "Describe",
                        "Select"
                    ]
                }
            ],
            "resource": [
                {
                    "name": "",
                    "actions": []
                },
                {
                    "name": "",
                    "actions": []
                }
            ],
            "function": [
                {
                    "name": "",
                    "actions": []
                },
                {
                    "name": "",
                    "actions": []
                }
            ]
        }
    },
    "remove": {
        "allowedProjectList": [
            {
                "project": "project_name"
            },
            {
                "project": "project_2"
            }
        ],
        "resourceList": {
            "table": [
                {
                    "name": "table_name"
                },
                {
                    "name": "table_name"
                }
            ],
            "resource": [
                {
                    "name": ""
                },
                {
                    "name": ""
                }
            ],
            "function": [
                {
                    "name": ""
                },
                {
                    "name": ""
                }
            ]
        }
    }
}'),
}

model UpdatePackageResponseBody = {
  data?: string(name='data', description='The returned data.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc1ec4016697018733156991e0888'),
}

model UpdatePackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePackageResponseBody(name='body'),
}

/**
 * @summary Updates the objects in a package and projects in which the package can be installed.
 *
 * @param request UpdatePackageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePackageResponse
 */
async function updatePackageWithOptions(projectName: string, packageName: string, request: UpdatePackageRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdatePackageResponse {
  request.validate();
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdatePackage',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/packages/${$URL.percentEncode(packageName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the objects in a package and projects in which the package can be installed.
 *
 * @param request UpdatePackageRequest
 * @return UpdatePackageResponse
 */
async function updatePackage(projectName: string, packageName: string, request: UpdatePackageRequest): UpdatePackageResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updatePackageWithOptions(projectName, packageName, request, headers, runtime);
}

model UpdateProjectBasicMetaRequest {
  comment?: string(name='comment', description='The project description.', example='BI_Analysis'),
  properties?: {
    allowFullScan?: boolean(name='allowFullScan', description='Indicates whether a full table scan is allowed in the project. A full table scan occupies a large number of resources, which reduces data processing efficiency. By default, the full table scan feature is disabled.', example='false'),
    enableDecimal2?: boolean(name='enableDecimal2', description='Indicates whether the DECIMAL type of the MaxCompute V2.0 data type edition is enabled.', example='true'),
    enableDr?: boolean(name='enableDr'),
    enableTunnelQuotaRoute?: boolean(name='enableTunnelQuotaRoute', description='Indicates whether the routing of the Tunnel resource group is enabled.

- true: The data transfer tasks that are submitted by the project by default use the Tunnel resource group that is bound to the project.
- false: The data transfer tasks that are submitted by the project by default use the Tunnel shared resource group.', example='true'),
    encryption?: {
      algorithm?: string(name='algorithm', description='The data encryption algorithm that is supported by the key. Valid values: AES256, AESCTR, and RC4.', example='AES256'),
      enable?: boolean(name='enable', description='Indicates whether the data encryption feature needs to be enabled for the project. For more information about data encryption, see
<props="china">[Storage Encryption](https://help.aliyun.com/zh/maxcompute/security-and-compliance/storage-encryption)
<props="intl">[Storage Encryption](https://www.alibabacloud.com/help/zh/maxcompute/security-and-compliance/storage-encryption).', example='true'),
      key?: string(name='key', description='The type of key that is used for data encryption. You can select MaxCompute Default Key or Bring Your Own Key (BYOK) as the key type. If you select MaxCompute Default Key, the default key that is created by MaxCompute is used.', example='default'),
    }(name='encryption', description='The storage encryption properties.'),
    retentionDays?: long(name='retentionDays', description='The retention period for backup data. Unit: days. During the retention period, you can restore data of the version in use to the backup data of any version. Valid values: [0,30]. Default value: 1. The value 0 indicates that the backup feature is disabled.', example='1'),
    sqlMeteringMax?: string(name='sqlMeteringMax', description='The maximum consumption threshold of a single SQL statement. Formula: Amount of scanned data (GB) × Complexity.', example='1500'),
    tableLifecycle?: {
      type?: string(name='type', description='The lifecycle type. Valid values:
- *mandatory*: The lifecycle clause is required in a table creation statement.
- *optional*: The lifecycle clause is optional in a table creation statement. If you do not configure a lifecycle for a table, the table does not expire.
- *inherit*: If you do not configure a lifecycle for a table when you create the table, the value of the odps.table.lifecycle.value parameter is used as the table lifecycle by default.', example='optional'),
      value?: string(name='value', description='The table lifecycle. Unit: days. Valid values: 1 to 37231. Default value: 37231.', example='37231'),
    }(name='tableLifecycle', description='The table lifecycle properties.'),
    timezone?: string(name='timezone', description='The time zone that is used by your project. The time zone is the same as the time zone specified by `odps.sql.timezone` .', example='Asia/Shanghai'),
    tunnelQuota?: string(name='tunnelQuota', description='The <props="china">[Data Transmission Service](https://help.aliyun.com/zh/maxcompute/user-guide/overview-of-dts)
<props="intl">[Data Transmission Service](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/overview-of-dts) resource group that is bound to the project.

- Default resource group: The Tunnel shared resource group is used. You cannot use the subscription-based Tunnel resource group for the project. The default resource group is automatically used by the Tunnel service of your project, regardless of the parameter setting.
- Subscription-based Tunnel resource group: You can use the subscription-based Tunnel resource group for the project.', example='Default'),
    typeSystem?: string(name='typeSystem', description='The data type edition. Valid values:

- *1*: MaxCompute V1.0 data type edition
- *2*: MaxCompute V2.0 data type edition
- *hive*: Hive-compatible data type edition
For more information about the differences among the three data type editions, see <props="china">[Data Type Versions](https://help.aliyun.com/zh/maxcompute/user-guide/data-type-editions)
<props="intl">[Data Type Versions](https://www.alibabacloud.com/help/zh/maxcompute/user-guide/data-type-editions).', example='2.0'),
  }(name='properties', description='The basic properties of the project.'),
}

model UpdateProjectBasicMetaResponseBody = {
  data?: string(name='data', description='The data returned.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

- 1xx: informational response. The request is received and is being processed.
- 2xx: success. The request is successfully received, understood, and accepted by the server.
- 3xx: redirection. The request is redirected, and further actions are required to complete the request.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0b87b7e216652820458545253e8b0a'),
}

model UpdateProjectBasicMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectBasicMetaResponseBody(name='body'),
}

/**
 * @summary Update Project Basic Information
 *
 * @param request UpdateProjectBasicMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectBasicMetaResponse
 */
async function updateProjectBasicMetaWithOptions(projectName: string, request: UpdateProjectBasicMetaRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateProjectBasicMetaResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.comment)) {
    body['comment'] = request.comment;
  }
  if (!$isNull(request.properties)) {
    body['properties'] = request.properties;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateProjectBasicMeta',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/meta`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update Project Basic Information
 *
 * @param request UpdateProjectBasicMetaRequest
 * @return UpdateProjectBasicMetaResponse
 */
async function updateProjectBasicMeta(projectName: string, request: UpdateProjectBasicMetaRequest): UpdateProjectBasicMetaResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectBasicMetaWithOptions(projectName, request, headers, runtime);
}

model UpdateProjectDefaultQuotaRequest {
  quota?: string(name='quota', description='The default computing quota that is used to allocate computing resources, the jobs that are initiated by this project consume the computing resources in the default quota.', example='os_PayAsYouGoQuota'),
}

model UpdateProjectDefaultQuotaResponseBody = {
  data?: string(name='data', description='The data returned.', example='success'),
  requestId?: string(name='requestId', description='The request ID.', example='0a06dfe716674588654372173ec0da'),
}

model UpdateProjectDefaultQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectDefaultQuotaResponseBody(name='body'),
}

/**
 * @summary Modify Default Project Compute Quota
 *
 * @param request UpdateProjectDefaultQuotaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectDefaultQuotaResponse
 */
async function updateProjectDefaultQuotaWithOptions(projectName: string, request: UpdateProjectDefaultQuotaRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateProjectDefaultQuotaResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.quota)) {
    body['quota'] = request.quota;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateProjectDefaultQuota',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/quota`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modify Default Project Compute Quota
 *
 * @param request UpdateProjectDefaultQuotaRequest
 * @return UpdateProjectDefaultQuotaResponse
 */
async function updateProjectDefaultQuota(projectName: string, request: UpdateProjectDefaultQuotaRequest): UpdateProjectDefaultQuotaResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectDefaultQuotaWithOptions(projectName, request, headers, runtime);
}

model UpdateProjectIpWhiteListRequest {
  body?: string(name='body', description='The request body parameters.', example='json {"ipWhiteList":{"ipList": "", // The IP address whitelists are of the STRING data type. Separate multiple IP address whitelists with commas (,). "vpcIpList": "", //} }'),
}

model UpdateProjectIpWhiteListResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0bc12e4316675560945192024e1044'),
}

model UpdateProjectIpWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectIpWhiteListResponseBody(name='body'),
}

/**
 * @summary Modifies the IP address whitelist of a MaxCompute project.
 *
 * @param request UpdateProjectIpWhiteListRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectIpWhiteListResponse
 */
async function updateProjectIpWhiteListWithOptions(projectName: string, request: UpdateProjectIpWhiteListRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateProjectIpWhiteListResponse {
  request.validate();
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateProjectIpWhiteList',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/projects/${$URL.percentEncode(projectName)}/ipWhiteList`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the IP address whitelist of a MaxCompute project.
 *
 * @param request UpdateProjectIpWhiteListRequest
 * @return UpdateProjectIpWhiteListResponse
 */
async function updateProjectIpWhiteList(projectName: string, request: UpdateProjectIpWhiteListRequest): UpdateProjectIpWhiteListResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectIpWhiteListWithOptions(projectName, request, headers, runtime);
}

model UpdateQuotaPlanRequest {
  body?: string(name='body', description='The request body parameters.', example='{ "name": "planA", // The quota is a level-1 quota. You can select only the fields that are related to the quota plan. "quota": { "name": "a", "nickName": "aaa_nick", "tenantId": "10001", "regionId": "cn-hangzhou", "parentId": "0", "cluster": "AT-ODPS-TEST3", "parameter": { "minCU": 40, "maxCU": 40, "adhocCU": 0, "elasticMinCU": 40, "elasticMaxCU": 40, "enablePreemptiveScheduling": false, "forceReservedMin":true, "enablePriority":false, "singleJobCULimit":100, "adhocQuotaBeginTimeInSec": 1345, "adhocQuotaEndTimeInSec": 1234, "ignoreAdhocQuota":false }, "subQuotaInfoList": [ { "nickName": "WlmFuxiSecondaryOnlineQuotaTest", "name": "WlmFuxiSecondaryOnlineQuotaTest", "type": "FUXI_ONLINE", "tenantId": "10001", "regionId": "cn-hangzhou", "cluster": "AT-ODPS-TEST3", "parameter": { "minCU": 40, "maxCU": 40, "adhocCU": 0, "elasticMinCU": 40, "elasticMaxCU": 40, "enablePreemptiveScheduling": false, "forceReservedMin":true, "enablePriority":false, "singleJobCULimit":100, "adhocQuotaBeginTimeInSec": 1345, "adhocQuotaEndTimeInSec": 1234, "ignoreAdhocQuota":false } } ] } }'),
  region?: string(name='region', description='The ID of the region.', example='cn-hangzhou'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
}

model UpdateQuotaPlanResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0a06dfe516688379832875789e2c65'),
}

model UpdateQuotaPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateQuotaPlanResponseBody(name='body'),
}

/**
 * @summary Updates a quota plan.
 *
 * @param request UpdateQuotaPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateQuotaPlanResponse
 */
async function updateQuotaPlanWithOptions(nickname: string, planName: string, request: UpdateQuotaPlanRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateQuotaPlanResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateQuotaPlan',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/plans/${$URL.percentEncode(planName)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates a quota plan.
 *
 * @param request UpdateQuotaPlanRequest
 * @return UpdateQuotaPlanResponse
 */
async function updateQuotaPlan(nickname: string, planName: string, request: UpdateQuotaPlanRequest): UpdateQuotaPlanResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateQuotaPlanWithOptions(nickname, planName, request, headers, runtime);
}

model UpdateQuotaScheduleRequest {
  body?: string(name='body', description='The request body parameters.', example='\\\\# The quota plan immediately takes effect. [ { "type": "once", "plan": "planA", "operator":"userA" } ] # The quota plan is scheduled on a regular basis. [ { "id": "etl_time", "type": "daily", "condition": { "at": "0800", "after": "2022-04-25T04:23:04Z" // optional }, "plan": "planA" }, { "id": "bi", "type": "daily", "condition": { "at": "0900", "after": "2022-04-25T04:23:04Z" // optional }, "plan": "planB" }, ]'),
  region?: string(name='region', description='The ID of the region.', example='cn-chengdu'),
  tenantId?: string(name='tenantId', description='The ID of the tenant.', example='478403690625249'),
}

model UpdateQuotaScheduleResponseBody = {
  data?: string(name='data', description='The returned result.', example='success'),
  requestId?: string(name='requestId', description='The ID of the request.', example='0a06dfe516691014920015940e1c9d'),
}

model UpdateQuotaScheduleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateQuotaScheduleResponseBody(name='body'),
}

/**
 * @summary Updates the scheduling plan for a quota plan.
 *
 * @param request UpdateQuotaScheduleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateQuotaScheduleResponse
 */
async function updateQuotaScheduleWithOptions(nickname: string, request: UpdateQuotaScheduleRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateQuotaScheduleResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.region)) {
    query['region'] = request.region;
  }
  if (!$isNull(request.tenantId)) {
    query['tenantId'] = request.tenantId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateQuotaSchedule',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/quotas/${$URL.percentEncode(nickname)}/schedule`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the scheduling plan for a quota plan.
 *
 * @param request UpdateQuotaScheduleRequest
 * @return UpdateQuotaScheduleResponse
 */
async function updateQuotaSchedule(nickname: string, request: UpdateQuotaScheduleRequest): UpdateQuotaScheduleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateQuotaScheduleWithOptions(nickname, request, headers, runtime);
}

model UpdateTunnelQuotaTimerRequest {
  body?: [ 
    {
      beginTime?: string(name='beginTime', description='The start time of the time-specific configuration.', example='00:00'),
      endTime?: string(name='endTime', description='The end time of the time-specific configuration.', example='08:00'),
      tunnelQuotaParameter?: {
        elasticReservedSlotNum?: long(name='elasticReservedSlotNum', description='The number of elastically reserved slots.', example='100'),
        slotNum?: long(name='slotNum', description='The number of reserved slots.', example='100'),
      }(name='tunnelQuotaParameter', description='The parameters for the time-specific configuration.'),
    }
  ](name='body', description='The request body.'),
  timezone?: string(name='timezone'),
}

model UpdateTunnelQuotaTimerResponseBody = {
  data?: string(name='data', description='The data returned.', example='success'),
  errorCode?: string(name='errorCode', description='The error code.', example='OBJECT_NOT_EXIST'),
  errorMsg?: string(name='errorMsg', description='The error message.', example='This object does not exist.'),
  httpCode?: int32(name='httpCode', description='The HTTP status code.

*   1xx: informational response. The request is received and is being processed.
*   2xx: success. The request is successfully received, understood, and accepted by the server.
*   3xx: redirection. The request is redirected, and further actions are required to complete the request.
*   4xx: client error. The request contains invalid request parameters or syntaxes, or specific request conditions cannot be met.
*   5xx: server error. The server cannot meet requirements due to other reasons.', example='200'),
  requestId?: string(name='requestId', description='The request ID.', example='0bc12e4316675560945192024e1044'),
}

model UpdateTunnelQuotaTimerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTunnelQuotaTimerResponseBody(name='body'),
}

/**
 * @summary Updates the time-specific configuration of an exclusive resource group for Tunnel (referred to as Tunnel quota).
 *
 * @description Before you call this operation, make sure that you are familiar with the [billing and prices](https://www.alibabacloud.com/help/maxcompute/product-overview/data-transfer-fees-hourly-billing) of Tunnel quotas and elastically reserved computing resources.
 *
 * @param request UpdateTunnelQuotaTimerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTunnelQuotaTimerResponse
 */
async function updateTunnelQuotaTimerWithOptions(nickname: string, request: UpdateTunnelQuotaTimerRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateTunnelQuotaTimerResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.timezone)) {
    query['timezone'] = request.timezone;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.toArray(request.body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateTunnelQuotaTimer',
    version = '2022-01-04',
    protocol = 'HTTPS',
    pathname = `/api/v1/tunnel/${$URL.percentEncode(nickname)}/timers`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the time-specific configuration of an exclusive resource group for Tunnel (referred to as Tunnel quota).
 *
 * @description Before you call this operation, make sure that you are familiar with the [billing and prices](https://www.alibabacloud.com/help/maxcompute/product-overview/data-transfer-fees-hourly-billing) of Tunnel quotas and elastically reserved computing resources.
 *
 * @param request UpdateTunnelQuotaTimerRequest
 * @return UpdateTunnelQuotaTimerResponse
 */
async function updateTunnelQuotaTimer(nickname: string, request: UpdateTunnelQuotaTimerRequest): UpdateTunnelQuotaTimerResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTunnelQuotaTimerWithOptions(nickname, request, headers, runtime);
}

